{-# 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.LaunchConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticBeanstalk.Types.LaunchConfiguration where

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

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

-- |
-- Create a value of 'LaunchConfiguration' 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', 'launchConfiguration_name' - The name of the launch configuration.
newLaunchConfiguration ::
  LaunchConfiguration
newLaunchConfiguration :: LaunchConfiguration
newLaunchConfiguration =
  LaunchConfiguration' {$sel:name:LaunchConfiguration' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing}

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

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

instance Prelude.Hashable LaunchConfiguration where
  hashWithSalt :: Int -> LaunchConfiguration -> Int
hashWithSalt Int
_salt LaunchConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:LaunchConfiguration' :: LaunchConfiguration -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData LaunchConfiguration where
  rnf :: LaunchConfiguration -> ()
rnf LaunchConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:LaunchConfiguration' :: LaunchConfiguration -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name