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

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

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

-- |
-- Create a value of 'LaunchTemplate' 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:
--
-- 'id', 'launchTemplate_id' - The ID of the launch template.
newLaunchTemplate ::
  LaunchTemplate
newLaunchTemplate :: LaunchTemplate
newLaunchTemplate =
  LaunchTemplate' :: Maybe Text -> LaunchTemplate
LaunchTemplate' {$sel:id:LaunchTemplate' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The ID of the launch template.
launchTemplate_id :: Lens.Lens' LaunchTemplate (Prelude.Maybe Prelude.Text)
launchTemplate_id :: (Maybe Text -> f (Maybe Text))
-> LaunchTemplate -> f LaunchTemplate
launchTemplate_id = (LaunchTemplate -> Maybe Text)
-> (LaunchTemplate -> Maybe Text -> LaunchTemplate)
-> Lens LaunchTemplate LaunchTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplate' {Maybe Text
id :: Maybe Text
$sel:id:LaunchTemplate' :: LaunchTemplate -> Maybe Text
id} -> Maybe Text
id) (\s :: LaunchTemplate
s@LaunchTemplate' {} Maybe Text
a -> LaunchTemplate
s {$sel:id:LaunchTemplate' :: Maybe Text
id = Maybe Text
a} :: LaunchTemplate)

instance Core.FromXML LaunchTemplate where
  parseXML :: [Node] -> Either String LaunchTemplate
parseXML [Node]
x =
    Maybe Text -> LaunchTemplate
LaunchTemplate' (Maybe Text -> LaunchTemplate)
-> Either String (Maybe Text) -> Either String LaunchTemplate
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
"Id")

instance Prelude.Hashable LaunchTemplate

instance Prelude.NFData LaunchTemplate