{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.ApplicationAutoScaling.Types.ScalingActivity
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ApplicationAutoScaling.Types.ScalingActivity where

import Amazonka.ApplicationAutoScaling.Types.ScalableDimension
import Amazonka.ApplicationAutoScaling.Types.ScalingActivityStatusCode
import Amazonka.ApplicationAutoScaling.Types.ServiceNamespace
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents a scaling activity.
--
-- /See:/ 'newScalingActivity' smart constructor.
data ScalingActivity = ScalingActivity'
  { -- | A simple message about the current status of the scaling activity.
    ScalingActivity -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The Unix timestamp for when the scaling activity ended.
    ScalingActivity -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | The details about the scaling activity.
    ScalingActivity -> Maybe Text
details :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the scaling activity.
    ScalingActivity -> Text
activityId :: Prelude.Text,
    -- | The namespace of the Amazon Web Services service that provides the
    -- resource, or a @custom-resource@.
    ScalingActivity -> ServiceNamespace
serviceNamespace :: ServiceNamespace,
    -- | The identifier of the resource associated with the scaling activity.
    -- This string consists of the resource type and unique identifier.
    --
    -- -   ECS service - The resource type is @service@ and the unique
    --     identifier is the cluster name and service name. Example:
    --     @service\/default\/sample-webapp@.
    --
    -- -   Spot Fleet - The resource type is @spot-fleet-request@ and the
    --     unique identifier is the Spot Fleet request ID. Example:
    --     @spot-fleet-request\/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE@.
    --
    -- -   EMR cluster - The resource type is @instancegroup@ and the unique
    --     identifier is the cluster ID and instance group ID. Example:
    --     @instancegroup\/j-2EEZNYKUA1NTV\/ig-1791Y4E1L8YI0@.
    --
    -- -   AppStream 2.0 fleet - The resource type is @fleet@ and the unique
    --     identifier is the fleet name. Example: @fleet\/sample-fleet@.
    --
    -- -   DynamoDB table - The resource type is @table@ and the unique
    --     identifier is the table name. Example: @table\/my-table@.
    --
    -- -   DynamoDB global secondary index - The resource type is @index@ and
    --     the unique identifier is the index name. Example:
    --     @table\/my-table\/index\/my-table-index@.
    --
    -- -   Aurora DB cluster - The resource type is @cluster@ and the unique
    --     identifier is the cluster name. Example: @cluster:my-db-cluster@.
    --
    -- -   SageMaker endpoint variant - The resource type is @variant@ and the
    --     unique identifier is the resource ID. Example:
    --     @endpoint\/my-end-point\/variant\/KMeansClustering@.
    --
    -- -   Custom resources are not supported with a resource type. This
    --     parameter must specify the @OutputValue@ from the CloudFormation
    --     template stack used to access the resources. The unique identifier
    --     is defined by the service provider. More information is available in
    --     our
    --     <https://github.com/aws/aws-auto-scaling-custom-resource GitHub repository>.
    --
    -- -   Amazon Comprehend document classification endpoint - The resource
    --     type and unique identifier are specified using the endpoint ARN.
    --     Example:
    --     @arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint\/EXAMPLE@.
    --
    -- -   Amazon Comprehend entity recognizer endpoint - The resource type and
    --     unique identifier are specified using the endpoint ARN. Example:
    --     @arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint\/EXAMPLE@.
    --
    -- -   Lambda provisioned concurrency - The resource type is @function@ and
    --     the unique identifier is the function name with a function version
    --     or alias name suffix that is not @$LATEST@. Example:
    --     @function:my-function:prod@ or @function:my-function:1@.
    --
    -- -   Amazon Keyspaces table - The resource type is @table@ and the unique
    --     identifier is the table name. Example:
    --     @keyspace\/mykeyspace\/table\/mytable@.
    --
    -- -   Amazon MSK cluster - The resource type and unique identifier are
    --     specified using the cluster ARN. Example:
    --     @arn:aws:kafka:us-east-1:123456789012:cluster\/demo-cluster-1\/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5@.
    --
    -- -   Amazon ElastiCache replication group - The resource type is
    --     @replication-group@ and the unique identifier is the replication
    --     group name. Example: @replication-group\/mycluster@.
    --
    -- -   Neptune cluster - The resource type is @cluster@ and the unique
    --     identifier is the cluster name. Example: @cluster:mycluster@.
    ScalingActivity -> Text
resourceId :: Prelude.Text,
    -- | The scalable dimension. This string consists of the service namespace,
    -- resource type, and scaling property.
    --
    -- -   @ecs:service:DesiredCount@ - The desired task count of an ECS
    --     service.
    --
    -- -   @elasticmapreduce:instancegroup:InstanceCount@ - The instance count
    --     of an EMR Instance Group.
    --
    -- -   @ec2:spot-fleet-request:TargetCapacity@ - The target capacity of a
    --     Spot Fleet.
    --
    -- -   @appstream:fleet:DesiredCapacity@ - The desired capacity of an
    --     AppStream 2.0 fleet.
    --
    -- -   @dynamodb:table:ReadCapacityUnits@ - The provisioned read capacity
    --     for a DynamoDB table.
    --
    -- -   @dynamodb:table:WriteCapacityUnits@ - The provisioned write capacity
    --     for a DynamoDB table.
    --
    -- -   @dynamodb:index:ReadCapacityUnits@ - The provisioned read capacity
    --     for a DynamoDB global secondary index.
    --
    -- -   @dynamodb:index:WriteCapacityUnits@ - The provisioned write capacity
    --     for a DynamoDB global secondary index.
    --
    -- -   @rds:cluster:ReadReplicaCount@ - The count of Aurora Replicas in an
    --     Aurora DB cluster. Available for Aurora MySQL-compatible edition and
    --     Aurora PostgreSQL-compatible edition.
    --
    -- -   @sagemaker:variant:DesiredInstanceCount@ - The number of EC2
    --     instances for an SageMaker model endpoint variant.
    --
    -- -   @custom-resource:ResourceType:Property@ - The scalable dimension for
    --     a custom resource provided by your own application or service.
    --
    -- -   @comprehend:document-classifier-endpoint:DesiredInferenceUnits@ -
    --     The number of inference units for an Amazon Comprehend document
    --     classification endpoint.
    --
    -- -   @comprehend:entity-recognizer-endpoint:DesiredInferenceUnits@ - The
    --     number of inference units for an Amazon Comprehend entity recognizer
    --     endpoint.
    --
    -- -   @lambda:function:ProvisionedConcurrency@ - The provisioned
    --     concurrency for a Lambda function.
    --
    -- -   @cassandra:table:ReadCapacityUnits@ - The provisioned read capacity
    --     for an Amazon Keyspaces table.
    --
    -- -   @cassandra:table:WriteCapacityUnits@ - The provisioned write
    --     capacity for an Amazon Keyspaces table.
    --
    -- -   @kafka:broker-storage:VolumeSize@ - The provisioned volume size (in
    --     GiB) for brokers in an Amazon MSK cluster.
    --
    -- -   @elasticache:replication-group:NodeGroups@ - The number of node
    --     groups for an Amazon ElastiCache replication group.
    --
    -- -   @elasticache:replication-group:Replicas@ - The number of replicas
    --     per node group for an Amazon ElastiCache replication group.
    --
    -- -   @neptune:cluster:ReadReplicaCount@ - The count of read replicas in
    --     an Amazon Neptune DB cluster.
    ScalingActivity -> ScalableDimension
scalableDimension :: ScalableDimension,
    -- | A simple description of what action the scaling activity intends to
    -- accomplish.
    ScalingActivity -> Text
description :: Prelude.Text,
    -- | A simple description of what caused the scaling activity to happen.
    ScalingActivity -> Text
cause :: Prelude.Text,
    -- | The Unix timestamp for when the scaling activity began.
    ScalingActivity -> POSIX
startTime :: Core.POSIX,
    -- | Indicates the status of the scaling activity.
    ScalingActivity -> ScalingActivityStatusCode
statusCode :: ScalingActivityStatusCode
  }
  deriving (ScalingActivity -> ScalingActivity -> Bool
(ScalingActivity -> ScalingActivity -> Bool)
-> (ScalingActivity -> ScalingActivity -> Bool)
-> Eq ScalingActivity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScalingActivity -> ScalingActivity -> Bool
$c/= :: ScalingActivity -> ScalingActivity -> Bool
== :: ScalingActivity -> ScalingActivity -> Bool
$c== :: ScalingActivity -> ScalingActivity -> Bool
Prelude.Eq, ReadPrec [ScalingActivity]
ReadPrec ScalingActivity
Int -> ReadS ScalingActivity
ReadS [ScalingActivity]
(Int -> ReadS ScalingActivity)
-> ReadS [ScalingActivity]
-> ReadPrec ScalingActivity
-> ReadPrec [ScalingActivity]
-> Read ScalingActivity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScalingActivity]
$creadListPrec :: ReadPrec [ScalingActivity]
readPrec :: ReadPrec ScalingActivity
$creadPrec :: ReadPrec ScalingActivity
readList :: ReadS [ScalingActivity]
$creadList :: ReadS [ScalingActivity]
readsPrec :: Int -> ReadS ScalingActivity
$creadsPrec :: Int -> ReadS ScalingActivity
Prelude.Read, Int -> ScalingActivity -> ShowS
[ScalingActivity] -> ShowS
ScalingActivity -> String
(Int -> ScalingActivity -> ShowS)
-> (ScalingActivity -> String)
-> ([ScalingActivity] -> ShowS)
-> Show ScalingActivity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScalingActivity] -> ShowS
$cshowList :: [ScalingActivity] -> ShowS
show :: ScalingActivity -> String
$cshow :: ScalingActivity -> String
showsPrec :: Int -> ScalingActivity -> ShowS
$cshowsPrec :: Int -> ScalingActivity -> ShowS
Prelude.Show, (forall x. ScalingActivity -> Rep ScalingActivity x)
-> (forall x. Rep ScalingActivity x -> ScalingActivity)
-> Generic ScalingActivity
forall x. Rep ScalingActivity x -> ScalingActivity
forall x. ScalingActivity -> Rep ScalingActivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScalingActivity x -> ScalingActivity
$cfrom :: forall x. ScalingActivity -> Rep ScalingActivity x
Prelude.Generic)

-- |
-- Create a value of 'ScalingActivity' 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:
--
-- 'statusMessage', 'scalingActivity_statusMessage' - A simple message about the current status of the scaling activity.
--
-- 'endTime', 'scalingActivity_endTime' - The Unix timestamp for when the scaling activity ended.
--
-- 'details', 'scalingActivity_details' - The details about the scaling activity.
--
-- 'activityId', 'scalingActivity_activityId' - The unique identifier of the scaling activity.
--
-- 'serviceNamespace', 'scalingActivity_serviceNamespace' - The namespace of the Amazon Web Services service that provides the
-- resource, or a @custom-resource@.
--
-- 'resourceId', 'scalingActivity_resourceId' - The identifier of the resource associated with the scaling activity.
-- This string consists of the resource type and unique identifier.
--
-- -   ECS service - The resource type is @service@ and the unique
--     identifier is the cluster name and service name. Example:
--     @service\/default\/sample-webapp@.
--
-- -   Spot Fleet - The resource type is @spot-fleet-request@ and the
--     unique identifier is the Spot Fleet request ID. Example:
--     @spot-fleet-request\/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE@.
--
-- -   EMR cluster - The resource type is @instancegroup@ and the unique
--     identifier is the cluster ID and instance group ID. Example:
--     @instancegroup\/j-2EEZNYKUA1NTV\/ig-1791Y4E1L8YI0@.
--
-- -   AppStream 2.0 fleet - The resource type is @fleet@ and the unique
--     identifier is the fleet name. Example: @fleet\/sample-fleet@.
--
-- -   DynamoDB table - The resource type is @table@ and the unique
--     identifier is the table name. Example: @table\/my-table@.
--
-- -   DynamoDB global secondary index - The resource type is @index@ and
--     the unique identifier is the index name. Example:
--     @table\/my-table\/index\/my-table-index@.
--
-- -   Aurora DB cluster - The resource type is @cluster@ and the unique
--     identifier is the cluster name. Example: @cluster:my-db-cluster@.
--
-- -   SageMaker endpoint variant - The resource type is @variant@ and the
--     unique identifier is the resource ID. Example:
--     @endpoint\/my-end-point\/variant\/KMeansClustering@.
--
-- -   Custom resources are not supported with a resource type. This
--     parameter must specify the @OutputValue@ from the CloudFormation
--     template stack used to access the resources. The unique identifier
--     is defined by the service provider. More information is available in
--     our
--     <https://github.com/aws/aws-auto-scaling-custom-resource GitHub repository>.
--
-- -   Amazon Comprehend document classification endpoint - The resource
--     type and unique identifier are specified using the endpoint ARN.
--     Example:
--     @arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint\/EXAMPLE@.
--
-- -   Amazon Comprehend entity recognizer endpoint - The resource type and
--     unique identifier are specified using the endpoint ARN. Example:
--     @arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint\/EXAMPLE@.
--
-- -   Lambda provisioned concurrency - The resource type is @function@ and
--     the unique identifier is the function name with a function version
--     or alias name suffix that is not @$LATEST@. Example:
--     @function:my-function:prod@ or @function:my-function:1@.
--
-- -   Amazon Keyspaces table - The resource type is @table@ and the unique
--     identifier is the table name. Example:
--     @keyspace\/mykeyspace\/table\/mytable@.
--
-- -   Amazon MSK cluster - The resource type and unique identifier are
--     specified using the cluster ARN. Example:
--     @arn:aws:kafka:us-east-1:123456789012:cluster\/demo-cluster-1\/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5@.
--
-- -   Amazon ElastiCache replication group - The resource type is
--     @replication-group@ and the unique identifier is the replication
--     group name. Example: @replication-group\/mycluster@.
--
-- -   Neptune cluster - The resource type is @cluster@ and the unique
--     identifier is the cluster name. Example: @cluster:mycluster@.
--
-- 'scalableDimension', 'scalingActivity_scalableDimension' - The scalable dimension. This string consists of the service namespace,
-- resource type, and scaling property.
--
-- -   @ecs:service:DesiredCount@ - The desired task count of an ECS
--     service.
--
-- -   @elasticmapreduce:instancegroup:InstanceCount@ - The instance count
--     of an EMR Instance Group.
--
-- -   @ec2:spot-fleet-request:TargetCapacity@ - The target capacity of a
--     Spot Fleet.
--
-- -   @appstream:fleet:DesiredCapacity@ - The desired capacity of an
--     AppStream 2.0 fleet.
--
-- -   @dynamodb:table:ReadCapacityUnits@ - The provisioned read capacity
--     for a DynamoDB table.
--
-- -   @dynamodb:table:WriteCapacityUnits@ - The provisioned write capacity
--     for a DynamoDB table.
--
-- -   @dynamodb:index:ReadCapacityUnits@ - The provisioned read capacity
--     for a DynamoDB global secondary index.
--
-- -   @dynamodb:index:WriteCapacityUnits@ - The provisioned write capacity
--     for a DynamoDB global secondary index.
--
-- -   @rds:cluster:ReadReplicaCount@ - The count of Aurora Replicas in an
--     Aurora DB cluster. Available for Aurora MySQL-compatible edition and
--     Aurora PostgreSQL-compatible edition.
--
-- -   @sagemaker:variant:DesiredInstanceCount@ - The number of EC2
--     instances for an SageMaker model endpoint variant.
--
-- -   @custom-resource:ResourceType:Property@ - The scalable dimension for
--     a custom resource provided by your own application or service.
--
-- -   @comprehend:document-classifier-endpoint:DesiredInferenceUnits@ -
--     The number of inference units for an Amazon Comprehend document
--     classification endpoint.
--
-- -   @comprehend:entity-recognizer-endpoint:DesiredInferenceUnits@ - The
--     number of inference units for an Amazon Comprehend entity recognizer
--     endpoint.
--
-- -   @lambda:function:ProvisionedConcurrency@ - The provisioned
--     concurrency for a Lambda function.
--
-- -   @cassandra:table:ReadCapacityUnits@ - The provisioned read capacity
--     for an Amazon Keyspaces table.
--
-- -   @cassandra:table:WriteCapacityUnits@ - The provisioned write
--     capacity for an Amazon Keyspaces table.
--
-- -   @kafka:broker-storage:VolumeSize@ - The provisioned volume size (in
--     GiB) for brokers in an Amazon MSK cluster.
--
-- -   @elasticache:replication-group:NodeGroups@ - The number of node
--     groups for an Amazon ElastiCache replication group.
--
-- -   @elasticache:replication-group:Replicas@ - The number of replicas
--     per node group for an Amazon ElastiCache replication group.
--
-- -   @neptune:cluster:ReadReplicaCount@ - The count of read replicas in
--     an Amazon Neptune DB cluster.
--
-- 'description', 'scalingActivity_description' - A simple description of what action the scaling activity intends to
-- accomplish.
--
-- 'cause', 'scalingActivity_cause' - A simple description of what caused the scaling activity to happen.
--
-- 'startTime', 'scalingActivity_startTime' - The Unix timestamp for when the scaling activity began.
--
-- 'statusCode', 'scalingActivity_statusCode' - Indicates the status of the scaling activity.
newScalingActivity ::
  -- | 'activityId'
  Prelude.Text ->
  -- | 'serviceNamespace'
  ServiceNamespace ->
  -- | 'resourceId'
  Prelude.Text ->
  -- | 'scalableDimension'
  ScalableDimension ->
  -- | 'description'
  Prelude.Text ->
  -- | 'cause'
  Prelude.Text ->
  -- | 'startTime'
  Prelude.UTCTime ->
  -- | 'statusCode'
  ScalingActivityStatusCode ->
  ScalingActivity
newScalingActivity :: Text
-> ServiceNamespace
-> Text
-> ScalableDimension
-> Text
-> Text
-> UTCTime
-> ScalingActivityStatusCode
-> ScalingActivity
newScalingActivity
  Text
pActivityId_
  ServiceNamespace
pServiceNamespace_
  Text
pResourceId_
  ScalableDimension
pScalableDimension_
  Text
pDescription_
  Text
pCause_
  UTCTime
pStartTime_
  ScalingActivityStatusCode
pStatusCode_ =
    ScalingActivity' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Text
-> ServiceNamespace
-> Text
-> ScalableDimension
-> Text
-> Text
-> POSIX
-> ScalingActivityStatusCode
-> ScalingActivity
ScalingActivity'
      { $sel:statusMessage:ScalingActivity' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:endTime:ScalingActivity' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:details:ScalingActivity' :: Maybe Text
details = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:activityId:ScalingActivity' :: Text
activityId = Text
pActivityId_,
        $sel:serviceNamespace:ScalingActivity' :: ServiceNamespace
serviceNamespace = ServiceNamespace
pServiceNamespace_,
        $sel:resourceId:ScalingActivity' :: Text
resourceId = Text
pResourceId_,
        $sel:scalableDimension:ScalingActivity' :: ScalableDimension
scalableDimension = ScalableDimension
pScalableDimension_,
        $sel:description:ScalingActivity' :: Text
description = Text
pDescription_,
        $sel:cause:ScalingActivity' :: Text
cause = Text
pCause_,
        $sel:startTime:ScalingActivity' :: POSIX
startTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
        $sel:statusCode:ScalingActivity' :: ScalingActivityStatusCode
statusCode = ScalingActivityStatusCode
pStatusCode_
      }

-- | A simple message about the current status of the scaling activity.
scalingActivity_statusMessage :: Lens.Lens' ScalingActivity (Prelude.Maybe Prelude.Text)
scalingActivity_statusMessage :: (Maybe Text -> f (Maybe Text))
-> ScalingActivity -> f ScalingActivity
scalingActivity_statusMessage = (ScalingActivity -> Maybe Text)
-> (ScalingActivity -> Maybe Text -> ScalingActivity)
-> Lens ScalingActivity ScalingActivity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:ScalingActivity' :: ScalingActivity -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: ScalingActivity
s@ScalingActivity' {} Maybe Text
a -> ScalingActivity
s {$sel:statusMessage:ScalingActivity' :: Maybe Text
statusMessage = Maybe Text
a} :: ScalingActivity)

-- | The Unix timestamp for when the scaling activity ended.
scalingActivity_endTime :: Lens.Lens' ScalingActivity (Prelude.Maybe Prelude.UTCTime)
scalingActivity_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ScalingActivity -> f ScalingActivity
scalingActivity_endTime = (ScalingActivity -> Maybe POSIX)
-> (ScalingActivity -> Maybe POSIX -> ScalingActivity)
-> Lens ScalingActivity ScalingActivity (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:ScalingActivity' :: ScalingActivity -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: ScalingActivity
s@ScalingActivity' {} Maybe POSIX
a -> ScalingActivity
s {$sel:endTime:ScalingActivity' :: Maybe POSIX
endTime = Maybe POSIX
a} :: ScalingActivity) ((Maybe POSIX -> f (Maybe POSIX))
 -> ScalingActivity -> f ScalingActivity)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ScalingActivity
-> f ScalingActivity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The details about the scaling activity.
scalingActivity_details :: Lens.Lens' ScalingActivity (Prelude.Maybe Prelude.Text)
scalingActivity_details :: (Maybe Text -> f (Maybe Text))
-> ScalingActivity -> f ScalingActivity
scalingActivity_details = (ScalingActivity -> Maybe Text)
-> (ScalingActivity -> Maybe Text -> ScalingActivity)
-> Lens ScalingActivity ScalingActivity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {Maybe Text
details :: Maybe Text
$sel:details:ScalingActivity' :: ScalingActivity -> Maybe Text
details} -> Maybe Text
details) (\s :: ScalingActivity
s@ScalingActivity' {} Maybe Text
a -> ScalingActivity
s {$sel:details:ScalingActivity' :: Maybe Text
details = Maybe Text
a} :: ScalingActivity)

-- | The unique identifier of the scaling activity.
scalingActivity_activityId :: Lens.Lens' ScalingActivity Prelude.Text
scalingActivity_activityId :: (Text -> f Text) -> ScalingActivity -> f ScalingActivity
scalingActivity_activityId = (ScalingActivity -> Text)
-> (ScalingActivity -> Text -> ScalingActivity)
-> Lens ScalingActivity ScalingActivity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {Text
activityId :: Text
$sel:activityId:ScalingActivity' :: ScalingActivity -> Text
activityId} -> Text
activityId) (\s :: ScalingActivity
s@ScalingActivity' {} Text
a -> ScalingActivity
s {$sel:activityId:ScalingActivity' :: Text
activityId = Text
a} :: ScalingActivity)

-- | The namespace of the Amazon Web Services service that provides the
-- resource, or a @custom-resource@.
scalingActivity_serviceNamespace :: Lens.Lens' ScalingActivity ServiceNamespace
scalingActivity_serviceNamespace :: (ServiceNamespace -> f ServiceNamespace)
-> ScalingActivity -> f ScalingActivity
scalingActivity_serviceNamespace = (ScalingActivity -> ServiceNamespace)
-> (ScalingActivity -> ServiceNamespace -> ScalingActivity)
-> Lens
     ScalingActivity ScalingActivity ServiceNamespace ServiceNamespace
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {ServiceNamespace
serviceNamespace :: ServiceNamespace
$sel:serviceNamespace:ScalingActivity' :: ScalingActivity -> ServiceNamespace
serviceNamespace} -> ServiceNamespace
serviceNamespace) (\s :: ScalingActivity
s@ScalingActivity' {} ServiceNamespace
a -> ScalingActivity
s {$sel:serviceNamespace:ScalingActivity' :: ServiceNamespace
serviceNamespace = ServiceNamespace
a} :: ScalingActivity)

-- | The identifier of the resource associated with the scaling activity.
-- This string consists of the resource type and unique identifier.
--
-- -   ECS service - The resource type is @service@ and the unique
--     identifier is the cluster name and service name. Example:
--     @service\/default\/sample-webapp@.
--
-- -   Spot Fleet - The resource type is @spot-fleet-request@ and the
--     unique identifier is the Spot Fleet request ID. Example:
--     @spot-fleet-request\/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE@.
--
-- -   EMR cluster - The resource type is @instancegroup@ and the unique
--     identifier is the cluster ID and instance group ID. Example:
--     @instancegroup\/j-2EEZNYKUA1NTV\/ig-1791Y4E1L8YI0@.
--
-- -   AppStream 2.0 fleet - The resource type is @fleet@ and the unique
--     identifier is the fleet name. Example: @fleet\/sample-fleet@.
--
-- -   DynamoDB table - The resource type is @table@ and the unique
--     identifier is the table name. Example: @table\/my-table@.
--
-- -   DynamoDB global secondary index - The resource type is @index@ and
--     the unique identifier is the index name. Example:
--     @table\/my-table\/index\/my-table-index@.
--
-- -   Aurora DB cluster - The resource type is @cluster@ and the unique
--     identifier is the cluster name. Example: @cluster:my-db-cluster@.
--
-- -   SageMaker endpoint variant - The resource type is @variant@ and the
--     unique identifier is the resource ID. Example:
--     @endpoint\/my-end-point\/variant\/KMeansClustering@.
--
-- -   Custom resources are not supported with a resource type. This
--     parameter must specify the @OutputValue@ from the CloudFormation
--     template stack used to access the resources. The unique identifier
--     is defined by the service provider. More information is available in
--     our
--     <https://github.com/aws/aws-auto-scaling-custom-resource GitHub repository>.
--
-- -   Amazon Comprehend document classification endpoint - The resource
--     type and unique identifier are specified using the endpoint ARN.
--     Example:
--     @arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint\/EXAMPLE@.
--
-- -   Amazon Comprehend entity recognizer endpoint - The resource type and
--     unique identifier are specified using the endpoint ARN. Example:
--     @arn:aws:comprehend:us-west-2:123456789012:entity-recognizer-endpoint\/EXAMPLE@.
--
-- -   Lambda provisioned concurrency - The resource type is @function@ and
--     the unique identifier is the function name with a function version
--     or alias name suffix that is not @$LATEST@. Example:
--     @function:my-function:prod@ or @function:my-function:1@.
--
-- -   Amazon Keyspaces table - The resource type is @table@ and the unique
--     identifier is the table name. Example:
--     @keyspace\/mykeyspace\/table\/mytable@.
--
-- -   Amazon MSK cluster - The resource type and unique identifier are
--     specified using the cluster ARN. Example:
--     @arn:aws:kafka:us-east-1:123456789012:cluster\/demo-cluster-1\/6357e0b2-0e6a-4b86-a0b4-70df934c2e31-5@.
--
-- -   Amazon ElastiCache replication group - The resource type is
--     @replication-group@ and the unique identifier is the replication
--     group name. Example: @replication-group\/mycluster@.
--
-- -   Neptune cluster - The resource type is @cluster@ and the unique
--     identifier is the cluster name. Example: @cluster:mycluster@.
scalingActivity_resourceId :: Lens.Lens' ScalingActivity Prelude.Text
scalingActivity_resourceId :: (Text -> f Text) -> ScalingActivity -> f ScalingActivity
scalingActivity_resourceId = (ScalingActivity -> Text)
-> (ScalingActivity -> Text -> ScalingActivity)
-> Lens ScalingActivity ScalingActivity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {Text
resourceId :: Text
$sel:resourceId:ScalingActivity' :: ScalingActivity -> Text
resourceId} -> Text
resourceId) (\s :: ScalingActivity
s@ScalingActivity' {} Text
a -> ScalingActivity
s {$sel:resourceId:ScalingActivity' :: Text
resourceId = Text
a} :: ScalingActivity)

-- | The scalable dimension. This string consists of the service namespace,
-- resource type, and scaling property.
--
-- -   @ecs:service:DesiredCount@ - The desired task count of an ECS
--     service.
--
-- -   @elasticmapreduce:instancegroup:InstanceCount@ - The instance count
--     of an EMR Instance Group.
--
-- -   @ec2:spot-fleet-request:TargetCapacity@ - The target capacity of a
--     Spot Fleet.
--
-- -   @appstream:fleet:DesiredCapacity@ - The desired capacity of an
--     AppStream 2.0 fleet.
--
-- -   @dynamodb:table:ReadCapacityUnits@ - The provisioned read capacity
--     for a DynamoDB table.
--
-- -   @dynamodb:table:WriteCapacityUnits@ - The provisioned write capacity
--     for a DynamoDB table.
--
-- -   @dynamodb:index:ReadCapacityUnits@ - The provisioned read capacity
--     for a DynamoDB global secondary index.
--
-- -   @dynamodb:index:WriteCapacityUnits@ - The provisioned write capacity
--     for a DynamoDB global secondary index.
--
-- -   @rds:cluster:ReadReplicaCount@ - The count of Aurora Replicas in an
--     Aurora DB cluster. Available for Aurora MySQL-compatible edition and
--     Aurora PostgreSQL-compatible edition.
--
-- -   @sagemaker:variant:DesiredInstanceCount@ - The number of EC2
--     instances for an SageMaker model endpoint variant.
--
-- -   @custom-resource:ResourceType:Property@ - The scalable dimension for
--     a custom resource provided by your own application or service.
--
-- -   @comprehend:document-classifier-endpoint:DesiredInferenceUnits@ -
--     The number of inference units for an Amazon Comprehend document
--     classification endpoint.
--
-- -   @comprehend:entity-recognizer-endpoint:DesiredInferenceUnits@ - The
--     number of inference units for an Amazon Comprehend entity recognizer
--     endpoint.
--
-- -   @lambda:function:ProvisionedConcurrency@ - The provisioned
--     concurrency for a Lambda function.
--
-- -   @cassandra:table:ReadCapacityUnits@ - The provisioned read capacity
--     for an Amazon Keyspaces table.
--
-- -   @cassandra:table:WriteCapacityUnits@ - The provisioned write
--     capacity for an Amazon Keyspaces table.
--
-- -   @kafka:broker-storage:VolumeSize@ - The provisioned volume size (in
--     GiB) for brokers in an Amazon MSK cluster.
--
-- -   @elasticache:replication-group:NodeGroups@ - The number of node
--     groups for an Amazon ElastiCache replication group.
--
-- -   @elasticache:replication-group:Replicas@ - The number of replicas
--     per node group for an Amazon ElastiCache replication group.
--
-- -   @neptune:cluster:ReadReplicaCount@ - The count of read replicas in
--     an Amazon Neptune DB cluster.
scalingActivity_scalableDimension :: Lens.Lens' ScalingActivity ScalableDimension
scalingActivity_scalableDimension :: (ScalableDimension -> f ScalableDimension)
-> ScalingActivity -> f ScalingActivity
scalingActivity_scalableDimension = (ScalingActivity -> ScalableDimension)
-> (ScalingActivity -> ScalableDimension -> ScalingActivity)
-> Lens
     ScalingActivity ScalingActivity ScalableDimension ScalableDimension
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {ScalableDimension
scalableDimension :: ScalableDimension
$sel:scalableDimension:ScalingActivity' :: ScalingActivity -> ScalableDimension
scalableDimension} -> ScalableDimension
scalableDimension) (\s :: ScalingActivity
s@ScalingActivity' {} ScalableDimension
a -> ScalingActivity
s {$sel:scalableDimension:ScalingActivity' :: ScalableDimension
scalableDimension = ScalableDimension
a} :: ScalingActivity)

-- | A simple description of what action the scaling activity intends to
-- accomplish.
scalingActivity_description :: Lens.Lens' ScalingActivity Prelude.Text
scalingActivity_description :: (Text -> f Text) -> ScalingActivity -> f ScalingActivity
scalingActivity_description = (ScalingActivity -> Text)
-> (ScalingActivity -> Text -> ScalingActivity)
-> Lens ScalingActivity ScalingActivity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {Text
description :: Text
$sel:description:ScalingActivity' :: ScalingActivity -> Text
description} -> Text
description) (\s :: ScalingActivity
s@ScalingActivity' {} Text
a -> ScalingActivity
s {$sel:description:ScalingActivity' :: Text
description = Text
a} :: ScalingActivity)

-- | A simple description of what caused the scaling activity to happen.
scalingActivity_cause :: Lens.Lens' ScalingActivity Prelude.Text
scalingActivity_cause :: (Text -> f Text) -> ScalingActivity -> f ScalingActivity
scalingActivity_cause = (ScalingActivity -> Text)
-> (ScalingActivity -> Text -> ScalingActivity)
-> Lens ScalingActivity ScalingActivity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {Text
cause :: Text
$sel:cause:ScalingActivity' :: ScalingActivity -> Text
cause} -> Text
cause) (\s :: ScalingActivity
s@ScalingActivity' {} Text
a -> ScalingActivity
s {$sel:cause:ScalingActivity' :: Text
cause = Text
a} :: ScalingActivity)

-- | The Unix timestamp for when the scaling activity began.
scalingActivity_startTime :: Lens.Lens' ScalingActivity Prelude.UTCTime
scalingActivity_startTime :: (UTCTime -> f UTCTime) -> ScalingActivity -> f ScalingActivity
scalingActivity_startTime = (ScalingActivity -> POSIX)
-> (ScalingActivity -> POSIX -> ScalingActivity)
-> Lens ScalingActivity ScalingActivity POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {POSIX
startTime :: POSIX
$sel:startTime:ScalingActivity' :: ScalingActivity -> POSIX
startTime} -> POSIX
startTime) (\s :: ScalingActivity
s@ScalingActivity' {} POSIX
a -> ScalingActivity
s {$sel:startTime:ScalingActivity' :: POSIX
startTime = POSIX
a} :: ScalingActivity) ((POSIX -> f POSIX) -> ScalingActivity -> f ScalingActivity)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ScalingActivity
-> f ScalingActivity
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Indicates the status of the scaling activity.
scalingActivity_statusCode :: Lens.Lens' ScalingActivity ScalingActivityStatusCode
scalingActivity_statusCode :: (ScalingActivityStatusCode -> f ScalingActivityStatusCode)
-> ScalingActivity -> f ScalingActivity
scalingActivity_statusCode = (ScalingActivity -> ScalingActivityStatusCode)
-> (ScalingActivity
    -> ScalingActivityStatusCode -> ScalingActivity)
-> Lens
     ScalingActivity
     ScalingActivity
     ScalingActivityStatusCode
     ScalingActivityStatusCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScalingActivity' {ScalingActivityStatusCode
statusCode :: ScalingActivityStatusCode
$sel:statusCode:ScalingActivity' :: ScalingActivity -> ScalingActivityStatusCode
statusCode} -> ScalingActivityStatusCode
statusCode) (\s :: ScalingActivity
s@ScalingActivity' {} ScalingActivityStatusCode
a -> ScalingActivity
s {$sel:statusCode:ScalingActivity' :: ScalingActivityStatusCode
statusCode = ScalingActivityStatusCode
a} :: ScalingActivity)

instance Core.FromJSON ScalingActivity where
  parseJSON :: Value -> Parser ScalingActivity
parseJSON =
    String
-> (Object -> Parser ScalingActivity)
-> Value
-> Parser ScalingActivity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ScalingActivity"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Text
-> ServiceNamespace
-> Text
-> ScalableDimension
-> Text
-> Text
-> POSIX
-> ScalingActivityStatusCode
-> ScalingActivity
ScalingActivity'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Text
 -> ServiceNamespace
 -> Text
 -> ScalableDimension
 -> Text
 -> Text
 -> POSIX
 -> ScalingActivityStatusCode
 -> ScalingActivity)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Text
      -> ServiceNamespace
      -> Text
      -> ScalableDimension
      -> Text
      -> Text
      -> POSIX
      -> ScalingActivityStatusCode
      -> ScalingActivity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatusMessage")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Text
   -> ServiceNamespace
   -> Text
   -> ScalableDimension
   -> Text
   -> Text
   -> POSIX
   -> ScalingActivityStatusCode
   -> ScalingActivity)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Text
      -> ServiceNamespace
      -> Text
      -> ScalableDimension
      -> Text
      -> Text
      -> POSIX
      -> ScalingActivityStatusCode
      -> ScalingActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndTime")
            Parser
  (Maybe Text
   -> Text
   -> ServiceNamespace
   -> Text
   -> ScalableDimension
   -> Text
   -> Text
   -> POSIX
   -> ScalingActivityStatusCode
   -> ScalingActivity)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> ServiceNamespace
      -> Text
      -> ScalableDimension
      -> Text
      -> Text
      -> POSIX
      -> ScalingActivityStatusCode
      -> ScalingActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Details")
            Parser
  (Text
   -> ServiceNamespace
   -> Text
   -> ScalableDimension
   -> Text
   -> Text
   -> POSIX
   -> ScalingActivityStatusCode
   -> ScalingActivity)
-> Parser Text
-> Parser
     (ServiceNamespace
      -> Text
      -> ScalableDimension
      -> Text
      -> Text
      -> POSIX
      -> ScalingActivityStatusCode
      -> ScalingActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ActivityId")
            Parser
  (ServiceNamespace
   -> Text
   -> ScalableDimension
   -> Text
   -> Text
   -> POSIX
   -> ScalingActivityStatusCode
   -> ScalingActivity)
-> Parser ServiceNamespace
-> Parser
     (Text
      -> ScalableDimension
      -> Text
      -> Text
      -> POSIX
      -> ScalingActivityStatusCode
      -> ScalingActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ServiceNamespace
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ServiceNamespace")
            Parser
  (Text
   -> ScalableDimension
   -> Text
   -> Text
   -> POSIX
   -> ScalingActivityStatusCode
   -> ScalingActivity)
-> Parser Text
-> Parser
     (ScalableDimension
      -> Text
      -> Text
      -> POSIX
      -> ScalingActivityStatusCode
      -> ScalingActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ResourceId")
            Parser
  (ScalableDimension
   -> Text
   -> Text
   -> POSIX
   -> ScalingActivityStatusCode
   -> ScalingActivity)
-> Parser ScalableDimension
-> Parser
     (Text
      -> Text -> POSIX -> ScalingActivityStatusCode -> ScalingActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ScalableDimension
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ScalableDimension")
            Parser
  (Text
   -> Text -> POSIX -> ScalingActivityStatusCode -> ScalingActivity)
-> Parser Text
-> Parser
     (Text -> POSIX -> ScalingActivityStatusCode -> ScalingActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Description")
            Parser
  (Text -> POSIX -> ScalingActivityStatusCode -> ScalingActivity)
-> Parser Text
-> Parser (POSIX -> ScalingActivityStatusCode -> ScalingActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Cause")
            Parser (POSIX -> ScalingActivityStatusCode -> ScalingActivity)
-> Parser POSIX
-> Parser (ScalingActivityStatusCode -> ScalingActivity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StartTime")
            Parser (ScalingActivityStatusCode -> ScalingActivity)
-> Parser ScalingActivityStatusCode -> Parser ScalingActivity
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ScalingActivityStatusCode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StatusCode")
      )

instance Prelude.Hashable ScalingActivity

instance Prelude.NFData ScalingActivity