{-# 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.ElasticBeanstalk.Types.AutoScalingGroup
-- 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.ElasticBeanstalk.Types.AutoScalingGroup where

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

-- | Describes an Auto Scaling launch configuration.
--
-- /See:/ 'newAutoScalingGroup' smart constructor.
data AutoScalingGroup = AutoScalingGroup'
  { -- | The name of the @AutoScalingGroup@ .
    AutoScalingGroup -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (AutoScalingGroup -> AutoScalingGroup -> Bool
(AutoScalingGroup -> AutoScalingGroup -> Bool)
-> (AutoScalingGroup -> AutoScalingGroup -> Bool)
-> Eq AutoScalingGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingGroup -> AutoScalingGroup -> Bool
$c/= :: AutoScalingGroup -> AutoScalingGroup -> Bool
== :: AutoScalingGroup -> AutoScalingGroup -> Bool
$c== :: AutoScalingGroup -> AutoScalingGroup -> Bool
Prelude.Eq, ReadPrec [AutoScalingGroup]
ReadPrec AutoScalingGroup
Int -> ReadS AutoScalingGroup
ReadS [AutoScalingGroup]
(Int -> ReadS AutoScalingGroup)
-> ReadS [AutoScalingGroup]
-> ReadPrec AutoScalingGroup
-> ReadPrec [AutoScalingGroup]
-> Read AutoScalingGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingGroup]
$creadListPrec :: ReadPrec [AutoScalingGroup]
readPrec :: ReadPrec AutoScalingGroup
$creadPrec :: ReadPrec AutoScalingGroup
readList :: ReadS [AutoScalingGroup]
$creadList :: ReadS [AutoScalingGroup]
readsPrec :: Int -> ReadS AutoScalingGroup
$creadsPrec :: Int -> ReadS AutoScalingGroup
Prelude.Read, Int -> AutoScalingGroup -> ShowS
[AutoScalingGroup] -> ShowS
AutoScalingGroup -> String
(Int -> AutoScalingGroup -> ShowS)
-> (AutoScalingGroup -> String)
-> ([AutoScalingGroup] -> ShowS)
-> Show AutoScalingGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingGroup] -> ShowS
$cshowList :: [AutoScalingGroup] -> ShowS
show :: AutoScalingGroup -> String
$cshow :: AutoScalingGroup -> String
showsPrec :: Int -> AutoScalingGroup -> ShowS
$cshowsPrec :: Int -> AutoScalingGroup -> ShowS
Prelude.Show, (forall x. AutoScalingGroup -> Rep AutoScalingGroup x)
-> (forall x. Rep AutoScalingGroup x -> AutoScalingGroup)
-> Generic AutoScalingGroup
forall x. Rep AutoScalingGroup x -> AutoScalingGroup
forall x. AutoScalingGroup -> Rep AutoScalingGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoScalingGroup x -> AutoScalingGroup
$cfrom :: forall x. AutoScalingGroup -> Rep AutoScalingGroup x
Prelude.Generic)

-- |
-- Create a value of 'AutoScalingGroup' 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', 'autoScalingGroup_name' - The name of the @AutoScalingGroup@ .
newAutoScalingGroup ::
  AutoScalingGroup
newAutoScalingGroup :: AutoScalingGroup
newAutoScalingGroup =
  AutoScalingGroup' :: Maybe Text -> AutoScalingGroup
AutoScalingGroup' {$sel:name:AutoScalingGroup' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The name of the @AutoScalingGroup@ .
autoScalingGroup_name :: Lens.Lens' AutoScalingGroup (Prelude.Maybe Prelude.Text)
autoScalingGroup_name :: (Maybe Text -> f (Maybe Text))
-> AutoScalingGroup -> f AutoScalingGroup
autoScalingGroup_name = (AutoScalingGroup -> Maybe Text)
-> (AutoScalingGroup -> Maybe Text -> AutoScalingGroup)
-> Lens AutoScalingGroup AutoScalingGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroup' {Maybe Text
name :: Maybe Text
$sel:name:AutoScalingGroup' :: AutoScalingGroup -> Maybe Text
name} -> Maybe Text
name) (\s :: AutoScalingGroup
s@AutoScalingGroup' {} Maybe Text
a -> AutoScalingGroup
s {$sel:name:AutoScalingGroup' :: Maybe Text
name = Maybe Text
a} :: AutoScalingGroup)

instance Core.FromXML AutoScalingGroup where
  parseXML :: [Node] -> Either String AutoScalingGroup
parseXML [Node]
x =
    Maybe Text -> AutoScalingGroup
AutoScalingGroup' (Maybe Text -> AutoScalingGroup)
-> Either String (Maybe Text) -> Either String AutoScalingGroup
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Name")

instance Prelude.Hashable AutoScalingGroup

instance Prelude.NFData AutoScalingGroup