{-# 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.EC2.Types.LaunchTemplateLicenseConfiguration
-- 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.EC2.Types.LaunchTemplateLicenseConfiguration where

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

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

-- |
-- Create a value of 'LaunchTemplateLicenseConfiguration' 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:
--
-- 'licenseConfigurationArn', 'launchTemplateLicenseConfiguration_licenseConfigurationArn' - The Amazon Resource Name (ARN) of the license configuration.
newLaunchTemplateLicenseConfiguration ::
  LaunchTemplateLicenseConfiguration
newLaunchTemplateLicenseConfiguration :: LaunchTemplateLicenseConfiguration
newLaunchTemplateLicenseConfiguration =
  LaunchTemplateLicenseConfiguration'
    { $sel:licenseConfigurationArn:LaunchTemplateLicenseConfiguration' :: Maybe Text
licenseConfigurationArn =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the license configuration.
launchTemplateLicenseConfiguration_licenseConfigurationArn :: Lens.Lens' LaunchTemplateLicenseConfiguration (Prelude.Maybe Prelude.Text)
launchTemplateLicenseConfiguration_licenseConfigurationArn :: Lens' LaunchTemplateLicenseConfiguration (Maybe Text)
launchTemplateLicenseConfiguration_licenseConfigurationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateLicenseConfiguration' {Maybe Text
licenseConfigurationArn :: Maybe Text
$sel:licenseConfigurationArn:LaunchTemplateLicenseConfiguration' :: LaunchTemplateLicenseConfiguration -> Maybe Text
licenseConfigurationArn} -> Maybe Text
licenseConfigurationArn) (\s :: LaunchTemplateLicenseConfiguration
s@LaunchTemplateLicenseConfiguration' {} Maybe Text
a -> LaunchTemplateLicenseConfiguration
s {$sel:licenseConfigurationArn:LaunchTemplateLicenseConfiguration' :: Maybe Text
licenseConfigurationArn = Maybe Text
a} :: LaunchTemplateLicenseConfiguration)

instance
  Data.FromXML
    LaunchTemplateLicenseConfiguration
  where
  parseXML :: [Node] -> Either String LaunchTemplateLicenseConfiguration
parseXML [Node]
x =
    Maybe Text -> LaunchTemplateLicenseConfiguration
LaunchTemplateLicenseConfiguration'
      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
"licenseConfigurationArn")

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

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