{-# 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.AutoScalingConfigurationSummary
-- 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.AutoScalingConfigurationSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides summary information about an App Runner automatic scaling
-- configuration resource.
--
-- This type contains limited information about an auto scaling
-- configuration. It includes only identification information, without
-- configuration details. It\'s returned by the
-- ListAutoScalingConfigurations action. Complete configuration information
-- is returned by the CreateAutoScalingConfiguration,
-- DescribeAutoScalingConfiguration, and DeleteAutoScalingConfiguration
-- actions using the AutoScalingConfiguration type.
--
-- /See:/ 'newAutoScalingConfigurationSummary' smart constructor.
data AutoScalingConfigurationSummary = AutoScalingConfigurationSummary'
  { -- | The customer-provided auto scaling configuration name. It can be used in
    -- multiple revisions of a configuration.
    AutoScalingConfigurationSummary -> Maybe Text
autoScalingConfigurationName :: Prelude.Maybe Prelude.Text,
    -- | The revision of this auto scaling configuration. It\'s unique among all
    -- the active configurations (@\"Status\": \"ACTIVE\"@) with the same
    -- @AutoScalingConfigurationName@.
    AutoScalingConfigurationSummary -> Maybe Int
autoScalingConfigurationRevision :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) of this auto scaling configuration.
    AutoScalingConfigurationSummary -> Maybe Text
autoScalingConfigurationArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AutoScalingConfigurationSummary
-> AutoScalingConfigurationSummary -> Bool
(AutoScalingConfigurationSummary
 -> AutoScalingConfigurationSummary -> Bool)
-> (AutoScalingConfigurationSummary
    -> AutoScalingConfigurationSummary -> Bool)
-> Eq AutoScalingConfigurationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingConfigurationSummary
-> AutoScalingConfigurationSummary -> Bool
$c/= :: AutoScalingConfigurationSummary
-> AutoScalingConfigurationSummary -> Bool
== :: AutoScalingConfigurationSummary
-> AutoScalingConfigurationSummary -> Bool
$c== :: AutoScalingConfigurationSummary
-> AutoScalingConfigurationSummary -> Bool
Prelude.Eq, ReadPrec [AutoScalingConfigurationSummary]
ReadPrec AutoScalingConfigurationSummary
Int -> ReadS AutoScalingConfigurationSummary
ReadS [AutoScalingConfigurationSummary]
(Int -> ReadS AutoScalingConfigurationSummary)
-> ReadS [AutoScalingConfigurationSummary]
-> ReadPrec AutoScalingConfigurationSummary
-> ReadPrec [AutoScalingConfigurationSummary]
-> Read AutoScalingConfigurationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingConfigurationSummary]
$creadListPrec :: ReadPrec [AutoScalingConfigurationSummary]
readPrec :: ReadPrec AutoScalingConfigurationSummary
$creadPrec :: ReadPrec AutoScalingConfigurationSummary
readList :: ReadS [AutoScalingConfigurationSummary]
$creadList :: ReadS [AutoScalingConfigurationSummary]
readsPrec :: Int -> ReadS AutoScalingConfigurationSummary
$creadsPrec :: Int -> ReadS AutoScalingConfigurationSummary
Prelude.Read, Int -> AutoScalingConfigurationSummary -> ShowS
[AutoScalingConfigurationSummary] -> ShowS
AutoScalingConfigurationSummary -> String
(Int -> AutoScalingConfigurationSummary -> ShowS)
-> (AutoScalingConfigurationSummary -> String)
-> ([AutoScalingConfigurationSummary] -> ShowS)
-> Show AutoScalingConfigurationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingConfigurationSummary] -> ShowS
$cshowList :: [AutoScalingConfigurationSummary] -> ShowS
show :: AutoScalingConfigurationSummary -> String
$cshow :: AutoScalingConfigurationSummary -> String
showsPrec :: Int -> AutoScalingConfigurationSummary -> ShowS
$cshowsPrec :: Int -> AutoScalingConfigurationSummary -> ShowS
Prelude.Show, (forall x.
 AutoScalingConfigurationSummary
 -> Rep AutoScalingConfigurationSummary x)
-> (forall x.
    Rep AutoScalingConfigurationSummary x
    -> AutoScalingConfigurationSummary)
-> Generic AutoScalingConfigurationSummary
forall x.
Rep AutoScalingConfigurationSummary x
-> AutoScalingConfigurationSummary
forall x.
AutoScalingConfigurationSummary
-> Rep AutoScalingConfigurationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoScalingConfigurationSummary x
-> AutoScalingConfigurationSummary
$cfrom :: forall x.
AutoScalingConfigurationSummary
-> Rep AutoScalingConfigurationSummary x
Prelude.Generic)

-- |
-- Create a value of 'AutoScalingConfigurationSummary' 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:
--
-- 'autoScalingConfigurationName', 'autoScalingConfigurationSummary_autoScalingConfigurationName' - The customer-provided auto scaling configuration name. It can be used in
-- multiple revisions of a configuration.
--
-- 'autoScalingConfigurationRevision', 'autoScalingConfigurationSummary_autoScalingConfigurationRevision' - The revision of this auto scaling configuration. It\'s unique among all
-- the active configurations (@\"Status\": \"ACTIVE\"@) with the same
-- @AutoScalingConfigurationName@.
--
-- 'autoScalingConfigurationArn', 'autoScalingConfigurationSummary_autoScalingConfigurationArn' - The Amazon Resource Name (ARN) of this auto scaling configuration.
newAutoScalingConfigurationSummary ::
  AutoScalingConfigurationSummary
newAutoScalingConfigurationSummary :: AutoScalingConfigurationSummary
newAutoScalingConfigurationSummary =
  AutoScalingConfigurationSummary' :: Maybe Text
-> Maybe Int -> Maybe Text -> AutoScalingConfigurationSummary
AutoScalingConfigurationSummary'
    { $sel:autoScalingConfigurationName:AutoScalingConfigurationSummary' :: Maybe Text
autoScalingConfigurationName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingConfigurationRevision:AutoScalingConfigurationSummary' :: Maybe Int
autoScalingConfigurationRevision =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingConfigurationArn:AutoScalingConfigurationSummary' :: Maybe Text
autoScalingConfigurationArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

instance
  Core.FromJSON
    AutoScalingConfigurationSummary
  where
  parseJSON :: Value -> Parser AutoScalingConfigurationSummary
parseJSON =
    String
-> (Object -> Parser AutoScalingConfigurationSummary)
-> Value
-> Parser AutoScalingConfigurationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AutoScalingConfigurationSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Int -> Maybe Text -> AutoScalingConfigurationSummary
AutoScalingConfigurationSummary'
            (Maybe Text
 -> Maybe Int -> Maybe Text -> AutoScalingConfigurationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int -> Maybe Text -> AutoScalingConfigurationSummary)
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
"AutoScalingConfigurationName")
            Parser (Maybe Int -> Maybe Text -> AutoScalingConfigurationSummary)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> AutoScalingConfigurationSummary)
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 -> AutoScalingConfigurationSummary)
-> Parser (Maybe Text) -> Parser AutoScalingConfigurationSummary
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")
      )

instance
  Prelude.Hashable
    AutoScalingConfigurationSummary

instance
  Prelude.NFData
    AutoScalingConfigurationSummary