{-# 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.AppRunner.Types.AutoScalingConfiguration
-- 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.AppRunner.Types.AutoScalingConfiguration where

import Amazonka.AppRunner.Types.AutoScalingConfigurationStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an App Runner automatic scaling configuration resource.
-- Multiple revisions of a configuration have the same
-- @AutoScalingConfigurationName@ and different
-- @AutoScalingConfigurationRevision@ values.
--
-- A higher @MinSize@ increases the spread of your App Runner service over
-- more Availability Zones in the Amazon Web Services Region. The tradeoff
-- is a higher minimal cost.
--
-- A lower @MaxSize@ controls your cost. The tradeoff is lower
-- responsiveness during peak demand.
--
-- /See:/ 'newAutoScalingConfiguration' smart constructor.
data AutoScalingConfiguration = AutoScalingConfiguration'
  { -- | The current state of the auto scaling configuration. If the status of a
    -- configuration revision is @INACTIVE@, it was deleted and can\'t be used.
    -- Inactive configuration revisions are permanently removed some time after
    -- they are deleted.
    AutoScalingConfiguration -> Maybe AutoScalingConfigurationStatus
status :: Prelude.Maybe AutoScalingConfigurationStatus,
    -- | The customer-provided auto scaling configuration name. It can be used in
    -- multiple revisions of a configuration.
    AutoScalingConfiguration -> Maybe Text
autoScalingConfigurationName :: Prelude.Maybe Prelude.Text,
    -- | The time when the auto scaling configuration was created. It\'s in Unix
    -- time stamp format.
    AutoScalingConfiguration -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The maximum number of instances that a service scales up to. At most
    -- @MaxSize@ instances actively serve traffic for your service.
    AutoScalingConfiguration -> Maybe Int
maxSize :: Prelude.Maybe Prelude.Int,
    -- | The revision of this auto scaling configuration. It\'s unique among all
    -- the active configurations (@\"Status\": \"ACTIVE\"@) that share the same
    -- @AutoScalingConfigurationName@.
    AutoScalingConfiguration -> Maybe Int
autoScalingConfigurationRevision :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) of this auto scaling configuration.
    AutoScalingConfiguration -> Maybe Text
autoScalingConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | The minimum number of instances that App Runner provisions for a
    -- service. The service always has at least @MinSize@ provisioned
    -- instances. Some of them actively serve traffic. The rest of them
    -- (provisioned and inactive instances) are a cost-effective compute
    -- capacity reserve and are ready to be quickly activated. You pay for
    -- memory usage of all the provisioned instances. You pay for CPU usage of
    -- only the active subset.
    --
    -- App Runner temporarily doubles the number of provisioned instances
    -- during deployments, to maintain the same capacity for both old and new
    -- code.
    AutoScalingConfiguration -> Maybe Int
minSize :: Prelude.Maybe Prelude.Int,
    -- | The time when the auto scaling configuration was deleted. It\'s in Unix
    -- time stamp format.
    AutoScalingConfiguration -> Maybe POSIX
deletedAt :: Prelude.Maybe Core.POSIX,
    -- | It\'s set to @true@ for the configuration with the highest @Revision@
    -- among all configurations that share the same @Name@. It\'s set to
    -- @false@ otherwise.
    AutoScalingConfiguration -> Maybe Bool
latest :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of concurrent requests that an instance processes. If
    -- the number of concurrent requests exceeds this limit, App Runner scales
    -- the service up.
    AutoScalingConfiguration -> Maybe Int
maxConcurrency :: Prelude.Maybe Prelude.Int
  }
  deriving (AutoScalingConfiguration -> AutoScalingConfiguration -> Bool
(AutoScalingConfiguration -> AutoScalingConfiguration -> Bool)
-> (AutoScalingConfiguration -> AutoScalingConfiguration -> Bool)
-> Eq AutoScalingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingConfiguration -> AutoScalingConfiguration -> Bool
$c/= :: AutoScalingConfiguration -> AutoScalingConfiguration -> Bool
== :: AutoScalingConfiguration -> AutoScalingConfiguration -> Bool
$c== :: AutoScalingConfiguration -> AutoScalingConfiguration -> Bool
Prelude.Eq, ReadPrec [AutoScalingConfiguration]
ReadPrec AutoScalingConfiguration
Int -> ReadS AutoScalingConfiguration
ReadS [AutoScalingConfiguration]
(Int -> ReadS AutoScalingConfiguration)
-> ReadS [AutoScalingConfiguration]
-> ReadPrec AutoScalingConfiguration
-> ReadPrec [AutoScalingConfiguration]
-> Read AutoScalingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingConfiguration]
$creadListPrec :: ReadPrec [AutoScalingConfiguration]
readPrec :: ReadPrec AutoScalingConfiguration
$creadPrec :: ReadPrec AutoScalingConfiguration
readList :: ReadS [AutoScalingConfiguration]
$creadList :: ReadS [AutoScalingConfiguration]
readsPrec :: Int -> ReadS AutoScalingConfiguration
$creadsPrec :: Int -> ReadS AutoScalingConfiguration
Prelude.Read, Int -> AutoScalingConfiguration -> ShowS
[AutoScalingConfiguration] -> ShowS
AutoScalingConfiguration -> String
(Int -> AutoScalingConfiguration -> ShowS)
-> (AutoScalingConfiguration -> String)
-> ([AutoScalingConfiguration] -> ShowS)
-> Show AutoScalingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingConfiguration] -> ShowS
$cshowList :: [AutoScalingConfiguration] -> ShowS
show :: AutoScalingConfiguration -> String
$cshow :: AutoScalingConfiguration -> String
showsPrec :: Int -> AutoScalingConfiguration -> ShowS
$cshowsPrec :: Int -> AutoScalingConfiguration -> ShowS
Prelude.Show, (forall x.
 AutoScalingConfiguration -> Rep AutoScalingConfiguration x)
-> (forall x.
    Rep AutoScalingConfiguration x -> AutoScalingConfiguration)
-> Generic AutoScalingConfiguration
forall x.
Rep AutoScalingConfiguration x -> AutoScalingConfiguration
forall x.
AutoScalingConfiguration -> Rep AutoScalingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoScalingConfiguration x -> AutoScalingConfiguration
$cfrom :: forall x.
AutoScalingConfiguration -> Rep AutoScalingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AutoScalingConfiguration' 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:
--
-- 'status', 'autoScalingConfiguration_status' - The current state of the auto scaling configuration. If the status of a
-- configuration revision is @INACTIVE@, it was deleted and can\'t be used.
-- Inactive configuration revisions are permanently removed some time after
-- they are deleted.
--
-- 'autoScalingConfigurationName', 'autoScalingConfiguration_autoScalingConfigurationName' - The customer-provided auto scaling configuration name. It can be used in
-- multiple revisions of a configuration.
--
-- 'createdAt', 'autoScalingConfiguration_createdAt' - The time when the auto scaling configuration was created. It\'s in Unix
-- time stamp format.
--
-- 'maxSize', 'autoScalingConfiguration_maxSize' - The maximum number of instances that a service scales up to. At most
-- @MaxSize@ instances actively serve traffic for your service.
--
-- 'autoScalingConfigurationRevision', 'autoScalingConfiguration_autoScalingConfigurationRevision' - The revision of this auto scaling configuration. It\'s unique among all
-- the active configurations (@\"Status\": \"ACTIVE\"@) that share the same
-- @AutoScalingConfigurationName@.
--
-- 'autoScalingConfigurationArn', 'autoScalingConfiguration_autoScalingConfigurationArn' - The Amazon Resource Name (ARN) of this auto scaling configuration.
--
-- 'minSize', 'autoScalingConfiguration_minSize' - The minimum number of instances that App Runner provisions for a
-- service. The service always has at least @MinSize@ provisioned
-- instances. Some of them actively serve traffic. The rest of them
-- (provisioned and inactive instances) are a cost-effective compute
-- capacity reserve and are ready to be quickly activated. You pay for
-- memory usage of all the provisioned instances. You pay for CPU usage of
-- only the active subset.
--
-- App Runner temporarily doubles the number of provisioned instances
-- during deployments, to maintain the same capacity for both old and new
-- code.
--
-- 'deletedAt', 'autoScalingConfiguration_deletedAt' - The time when the auto scaling configuration was deleted. It\'s in Unix
-- time stamp format.
--
-- 'latest', 'autoScalingConfiguration_latest' - It\'s set to @true@ for the configuration with the highest @Revision@
-- among all configurations that share the same @Name@. It\'s set to
-- @false@ otherwise.
--
-- 'maxConcurrency', 'autoScalingConfiguration_maxConcurrency' - The maximum number of concurrent requests that an instance processes. If
-- the number of concurrent requests exceeds this limit, App Runner scales
-- the service up.
newAutoScalingConfiguration ::
  AutoScalingConfiguration
newAutoScalingConfiguration :: AutoScalingConfiguration
newAutoScalingConfiguration =
  AutoScalingConfiguration' :: Maybe AutoScalingConfigurationStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe POSIX
-> Maybe Bool
-> Maybe Int
-> AutoScalingConfiguration
AutoScalingConfiguration'
    { $sel:status:AutoScalingConfiguration' :: Maybe AutoScalingConfigurationStatus
status = Maybe AutoScalingConfigurationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingConfigurationName:AutoScalingConfiguration' :: Maybe Text
autoScalingConfigurationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:AutoScalingConfiguration' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:maxSize:AutoScalingConfiguration' :: Maybe Int
maxSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingConfigurationRevision:AutoScalingConfiguration' :: Maybe Int
autoScalingConfigurationRevision =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingConfigurationArn:AutoScalingConfiguration' :: Maybe Text
autoScalingConfigurationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:minSize:AutoScalingConfiguration' :: Maybe Int
minSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:deletedAt:AutoScalingConfiguration' :: Maybe POSIX
deletedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latest:AutoScalingConfiguration' :: Maybe Bool
latest = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:maxConcurrency:AutoScalingConfiguration' :: Maybe Int
maxConcurrency = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The current state of the auto scaling configuration. If the status of a
-- configuration revision is @INACTIVE@, it was deleted and can\'t be used.
-- Inactive configuration revisions are permanently removed some time after
-- they are deleted.
autoScalingConfiguration_status :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe AutoScalingConfigurationStatus)
autoScalingConfiguration_status :: (Maybe AutoScalingConfigurationStatus
 -> f (Maybe AutoScalingConfigurationStatus))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_status = (AutoScalingConfiguration -> Maybe AutoScalingConfigurationStatus)
-> (AutoScalingConfiguration
    -> Maybe AutoScalingConfigurationStatus
    -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe AutoScalingConfigurationStatus)
     (Maybe AutoScalingConfigurationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe AutoScalingConfigurationStatus
status :: Maybe AutoScalingConfigurationStatus
$sel:status:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe AutoScalingConfigurationStatus
status} -> Maybe AutoScalingConfigurationStatus
status) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe AutoScalingConfigurationStatus
a -> AutoScalingConfiguration
s {$sel:status:AutoScalingConfiguration' :: Maybe AutoScalingConfigurationStatus
status = Maybe AutoScalingConfigurationStatus
a} :: AutoScalingConfiguration)

-- | The customer-provided auto scaling configuration name. It can be used in
-- multiple revisions of a configuration.
autoScalingConfiguration_autoScalingConfigurationName :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe Prelude.Text)
autoScalingConfiguration_autoScalingConfigurationName :: (Maybe Text -> f (Maybe Text))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_autoScalingConfigurationName = (AutoScalingConfiguration -> Maybe Text)
-> (AutoScalingConfiguration
    -> Maybe Text -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe Text
autoScalingConfigurationName :: Maybe Text
$sel:autoScalingConfigurationName:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe Text
autoScalingConfigurationName} -> Maybe Text
autoScalingConfigurationName) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe Text
a -> AutoScalingConfiguration
s {$sel:autoScalingConfigurationName:AutoScalingConfiguration' :: Maybe Text
autoScalingConfigurationName = Maybe Text
a} :: AutoScalingConfiguration)

-- | The time when the auto scaling configuration was created. It\'s in Unix
-- time stamp format.
autoScalingConfiguration_createdAt :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe Prelude.UTCTime)
autoScalingConfiguration_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_createdAt = (AutoScalingConfiguration -> Maybe POSIX)
-> (AutoScalingConfiguration
    -> Maybe POSIX -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe POSIX
a -> AutoScalingConfiguration
s {$sel:createdAt:AutoScalingConfiguration' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: AutoScalingConfiguration) ((Maybe POSIX -> f (Maybe POSIX))
 -> AutoScalingConfiguration -> f AutoScalingConfiguration)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AutoScalingConfiguration
-> f AutoScalingConfiguration
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 maximum number of instances that a service scales up to. At most
-- @MaxSize@ instances actively serve traffic for your service.
autoScalingConfiguration_maxSize :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe Prelude.Int)
autoScalingConfiguration_maxSize :: (Maybe Int -> f (Maybe Int))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_maxSize = (AutoScalingConfiguration -> Maybe Int)
-> (AutoScalingConfiguration
    -> Maybe Int -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe Int
maxSize :: Maybe Int
$sel:maxSize:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe Int
maxSize} -> Maybe Int
maxSize) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe Int
a -> AutoScalingConfiguration
s {$sel:maxSize:AutoScalingConfiguration' :: Maybe Int
maxSize = Maybe Int
a} :: AutoScalingConfiguration)

-- | The revision of this auto scaling configuration. It\'s unique among all
-- the active configurations (@\"Status\": \"ACTIVE\"@) that share the same
-- @AutoScalingConfigurationName@.
autoScalingConfiguration_autoScalingConfigurationRevision :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe Prelude.Int)
autoScalingConfiguration_autoScalingConfigurationRevision :: (Maybe Int -> f (Maybe Int))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_autoScalingConfigurationRevision = (AutoScalingConfiguration -> Maybe Int)
-> (AutoScalingConfiguration
    -> Maybe Int -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe Int
autoScalingConfigurationRevision :: Maybe Int
$sel:autoScalingConfigurationRevision:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe Int
autoScalingConfigurationRevision} -> Maybe Int
autoScalingConfigurationRevision) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe Int
a -> AutoScalingConfiguration
s {$sel:autoScalingConfigurationRevision:AutoScalingConfiguration' :: Maybe Int
autoScalingConfigurationRevision = Maybe Int
a} :: AutoScalingConfiguration)

-- | The Amazon Resource Name (ARN) of this auto scaling configuration.
autoScalingConfiguration_autoScalingConfigurationArn :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe Prelude.Text)
autoScalingConfiguration_autoScalingConfigurationArn :: (Maybe Text -> f (Maybe Text))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_autoScalingConfigurationArn = (AutoScalingConfiguration -> Maybe Text)
-> (AutoScalingConfiguration
    -> Maybe Text -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe Text
autoScalingConfigurationArn :: Maybe Text
$sel:autoScalingConfigurationArn:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe Text
autoScalingConfigurationArn} -> Maybe Text
autoScalingConfigurationArn) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe Text
a -> AutoScalingConfiguration
s {$sel:autoScalingConfigurationArn:AutoScalingConfiguration' :: Maybe Text
autoScalingConfigurationArn = Maybe Text
a} :: AutoScalingConfiguration)

-- | The minimum number of instances that App Runner provisions for a
-- service. The service always has at least @MinSize@ provisioned
-- instances. Some of them actively serve traffic. The rest of them
-- (provisioned and inactive instances) are a cost-effective compute
-- capacity reserve and are ready to be quickly activated. You pay for
-- memory usage of all the provisioned instances. You pay for CPU usage of
-- only the active subset.
--
-- App Runner temporarily doubles the number of provisioned instances
-- during deployments, to maintain the same capacity for both old and new
-- code.
autoScalingConfiguration_minSize :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe Prelude.Int)
autoScalingConfiguration_minSize :: (Maybe Int -> f (Maybe Int))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_minSize = (AutoScalingConfiguration -> Maybe Int)
-> (AutoScalingConfiguration
    -> Maybe Int -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe Int
minSize :: Maybe Int
$sel:minSize:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe Int
minSize} -> Maybe Int
minSize) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe Int
a -> AutoScalingConfiguration
s {$sel:minSize:AutoScalingConfiguration' :: Maybe Int
minSize = Maybe Int
a} :: AutoScalingConfiguration)

-- | The time when the auto scaling configuration was deleted. It\'s in Unix
-- time stamp format.
autoScalingConfiguration_deletedAt :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe Prelude.UTCTime)
autoScalingConfiguration_deletedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_deletedAt = (AutoScalingConfiguration -> Maybe POSIX)
-> (AutoScalingConfiguration
    -> Maybe POSIX -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe POSIX
deletedAt :: Maybe POSIX
$sel:deletedAt:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe POSIX
deletedAt} -> Maybe POSIX
deletedAt) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe POSIX
a -> AutoScalingConfiguration
s {$sel:deletedAt:AutoScalingConfiguration' :: Maybe POSIX
deletedAt = Maybe POSIX
a} :: AutoScalingConfiguration) ((Maybe POSIX -> f (Maybe POSIX))
 -> AutoScalingConfiguration -> f AutoScalingConfiguration)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AutoScalingConfiguration
-> f AutoScalingConfiguration
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

-- | It\'s set to @true@ for the configuration with the highest @Revision@
-- among all configurations that share the same @Name@. It\'s set to
-- @false@ otherwise.
autoScalingConfiguration_latest :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe Prelude.Bool)
autoScalingConfiguration_latest :: (Maybe Bool -> f (Maybe Bool))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_latest = (AutoScalingConfiguration -> Maybe Bool)
-> (AutoScalingConfiguration
    -> Maybe Bool -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe Bool
latest :: Maybe Bool
$sel:latest:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe Bool
latest} -> Maybe Bool
latest) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe Bool
a -> AutoScalingConfiguration
s {$sel:latest:AutoScalingConfiguration' :: Maybe Bool
latest = Maybe Bool
a} :: AutoScalingConfiguration)

-- | The maximum number of concurrent requests that an instance processes. If
-- the number of concurrent requests exceeds this limit, App Runner scales
-- the service up.
autoScalingConfiguration_maxConcurrency :: Lens.Lens' AutoScalingConfiguration (Prelude.Maybe Prelude.Int)
autoScalingConfiguration_maxConcurrency :: (Maybe Int -> f (Maybe Int))
-> AutoScalingConfiguration -> f AutoScalingConfiguration
autoScalingConfiguration_maxConcurrency = (AutoScalingConfiguration -> Maybe Int)
-> (AutoScalingConfiguration
    -> Maybe Int -> AutoScalingConfiguration)
-> Lens
     AutoScalingConfiguration
     AutoScalingConfiguration
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingConfiguration' {Maybe Int
maxConcurrency :: Maybe Int
$sel:maxConcurrency:AutoScalingConfiguration' :: AutoScalingConfiguration -> Maybe Int
maxConcurrency} -> Maybe Int
maxConcurrency) (\s :: AutoScalingConfiguration
s@AutoScalingConfiguration' {} Maybe Int
a -> AutoScalingConfiguration
s {$sel:maxConcurrency:AutoScalingConfiguration' :: Maybe Int
maxConcurrency = Maybe Int
a} :: AutoScalingConfiguration)

instance Core.FromJSON AutoScalingConfiguration where
  parseJSON :: Value -> Parser AutoScalingConfiguration
parseJSON =
    String
-> (Object -> Parser AutoScalingConfiguration)
-> Value
-> Parser AutoScalingConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AutoScalingConfiguration"
      ( \Object
x ->
          Maybe AutoScalingConfigurationStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe POSIX
-> Maybe Bool
-> Maybe Int
-> AutoScalingConfiguration
AutoScalingConfiguration'
            (Maybe AutoScalingConfigurationStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> Maybe POSIX
 -> Maybe Bool
 -> Maybe Int
 -> AutoScalingConfiguration)
-> Parser (Maybe AutoScalingConfigurationStatus)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Int
      -> AutoScalingConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AutoScalingConfigurationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Int
   -> AutoScalingConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Int
      -> AutoScalingConfiguration)
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
"AutoScalingConfigurationName")
            Parser
  (Maybe POSIX
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Int
   -> AutoScalingConfiguration)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Int
      -> AutoScalingConfiguration)
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
"CreatedAt")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Int
   -> AutoScalingConfiguration)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Int
      -> AutoScalingConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxSize")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Int
   -> AutoScalingConfiguration)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Int
      -> AutoScalingConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AutoScalingConfigurationRevision")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Int
   -> AutoScalingConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Int
      -> AutoScalingConfiguration)
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
"AutoScalingConfigurationArn")
            Parser
  (Maybe Int
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Int
   -> AutoScalingConfiguration)
-> Parser (Maybe Int)
-> Parser
     (Maybe POSIX
      -> Maybe Bool -> Maybe Int -> AutoScalingConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MinSize")
            Parser
  (Maybe POSIX
   -> Maybe Bool -> Maybe Int -> AutoScalingConfiguration)
-> Parser (Maybe POSIX)
-> Parser (Maybe Bool -> Maybe Int -> AutoScalingConfiguration)
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
"DeletedAt")
            Parser (Maybe Bool -> Maybe Int -> AutoScalingConfiguration)
-> Parser (Maybe Bool)
-> Parser (Maybe Int -> AutoScalingConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Latest")
            Parser (Maybe Int -> AutoScalingConfiguration)
-> Parser (Maybe Int) -> Parser AutoScalingConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxConcurrency")
      )

instance Prelude.Hashable AutoScalingConfiguration

instance Prelude.NFData AutoScalingConfiguration