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

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

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

instance Data.FromXML LicenseConfiguration where
  parseXML :: [Node] -> Either String LicenseConfiguration
parseXML [Node]
x =
    Maybe Text -> LicenseConfiguration
LicenseConfiguration'
      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 LicenseConfiguration where
  hashWithSalt :: Int -> LicenseConfiguration -> Int
hashWithSalt Int
_salt LicenseConfiguration' {Maybe Text
licenseConfigurationArn :: Maybe Text
$sel:licenseConfigurationArn:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
licenseConfigurationArn

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