{-# 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.LicenseManager.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.LicenseManager.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.LicenseManager.Types.AutomatedDiscoveryInformation
import Amazonka.LicenseManager.Types.ConsumedLicenseSummary
import Amazonka.LicenseManager.Types.LicenseCountingType
import Amazonka.LicenseManager.Types.ManagedResourceSummary
import Amazonka.LicenseManager.Types.ProductInformation
import qualified Amazonka.Prelude as Prelude

-- | A license configuration is an abstraction of a customer license
-- agreement that can be consumed and enforced by License Manager.
-- Components include specifications for the license type (licensing by
-- instance, socket, CPU, or vCPU), allowed tenancy (shared tenancy,
-- Dedicated Instance, Dedicated Host, or all of these), host affinity (how
-- long a VM must be associated with a host), and the number of licenses
-- purchased and used.
--
-- /See:/ 'newLicenseConfiguration' smart constructor.
data LicenseConfiguration = LicenseConfiguration'
  { -- | Automated discovery information.
    LicenseConfiguration -> Maybe AutomatedDiscoveryInformation
automatedDiscoveryInformation :: Prelude.Maybe AutomatedDiscoveryInformation,
    -- | Summaries for licenses consumed by various resources.
    LicenseConfiguration -> Maybe [ConsumedLicenseSummary]
consumedLicenseSummaryList :: Prelude.Maybe [ConsumedLicenseSummary],
    -- | Number of licenses consumed.
    LicenseConfiguration -> Maybe Integer
consumedLicenses :: Prelude.Maybe Prelude.Integer,
    -- | Description of the license configuration.
    LicenseConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | When true, disassociates a resource when software is uninstalled.
    LicenseConfiguration -> Maybe Bool
disassociateWhenNotFound :: Prelude.Maybe Prelude.Bool,
    -- | Amazon Resource Name (ARN) of the license configuration.
    LicenseConfiguration -> Maybe Text
licenseConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | Unique ID of the license configuration.
    LicenseConfiguration -> Maybe Text
licenseConfigurationId :: Prelude.Maybe Prelude.Text,
    -- | Number of licenses managed by the license configuration.
    LicenseConfiguration -> Maybe Integer
licenseCount :: Prelude.Maybe Prelude.Integer,
    -- | Number of available licenses as a hard limit.
    LicenseConfiguration -> Maybe Bool
licenseCountHardLimit :: Prelude.Maybe Prelude.Bool,
    -- | Dimension to use to track the license inventory.
    LicenseConfiguration -> Maybe LicenseCountingType
licenseCountingType :: Prelude.Maybe LicenseCountingType,
    -- | License rules.
    LicenseConfiguration -> Maybe [Text]
licenseRules :: Prelude.Maybe [Prelude.Text],
    -- | Summaries for managed resources.
    LicenseConfiguration -> Maybe [ManagedResourceSummary]
managedResourceSummaryList :: Prelude.Maybe [ManagedResourceSummary],
    -- | Name of the license configuration.
    LicenseConfiguration -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Account ID of the license configuration\'s owner.
    LicenseConfiguration -> Maybe Text
ownerAccountId :: Prelude.Maybe Prelude.Text,
    -- | Product information.
    LicenseConfiguration -> Maybe [ProductInformation]
productInformationList :: Prelude.Maybe [ProductInformation],
    -- | Status of the license configuration.
    LicenseConfiguration -> Maybe Text
status :: 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:
--
-- 'automatedDiscoveryInformation', 'licenseConfiguration_automatedDiscoveryInformation' - Automated discovery information.
--
-- 'consumedLicenseSummaryList', 'licenseConfiguration_consumedLicenseSummaryList' - Summaries for licenses consumed by various resources.
--
-- 'consumedLicenses', 'licenseConfiguration_consumedLicenses' - Number of licenses consumed.
--
-- 'description', 'licenseConfiguration_description' - Description of the license configuration.
--
-- 'disassociateWhenNotFound', 'licenseConfiguration_disassociateWhenNotFound' - When true, disassociates a resource when software is uninstalled.
--
-- 'licenseConfigurationArn', 'licenseConfiguration_licenseConfigurationArn' - Amazon Resource Name (ARN) of the license configuration.
--
-- 'licenseConfigurationId', 'licenseConfiguration_licenseConfigurationId' - Unique ID of the license configuration.
--
-- 'licenseCount', 'licenseConfiguration_licenseCount' - Number of licenses managed by the license configuration.
--
-- 'licenseCountHardLimit', 'licenseConfiguration_licenseCountHardLimit' - Number of available licenses as a hard limit.
--
-- 'licenseCountingType', 'licenseConfiguration_licenseCountingType' - Dimension to use to track the license inventory.
--
-- 'licenseRules', 'licenseConfiguration_licenseRules' - License rules.
--
-- 'managedResourceSummaryList', 'licenseConfiguration_managedResourceSummaryList' - Summaries for managed resources.
--
-- 'name', 'licenseConfiguration_name' - Name of the license configuration.
--
-- 'ownerAccountId', 'licenseConfiguration_ownerAccountId' - Account ID of the license configuration\'s owner.
--
-- 'productInformationList', 'licenseConfiguration_productInformationList' - Product information.
--
-- 'status', 'licenseConfiguration_status' - Status of the license configuration.
newLicenseConfiguration ::
  LicenseConfiguration
newLicenseConfiguration :: LicenseConfiguration
newLicenseConfiguration =
  LicenseConfiguration'
    { $sel:automatedDiscoveryInformation:LicenseConfiguration' :: Maybe AutomatedDiscoveryInformation
automatedDiscoveryInformation =
        forall a. Maybe a
Prelude.Nothing,
      $sel:consumedLicenseSummaryList:LicenseConfiguration' :: Maybe [ConsumedLicenseSummary]
consumedLicenseSummaryList = forall a. Maybe a
Prelude.Nothing,
      $sel:consumedLicenses:LicenseConfiguration' :: Maybe Integer
consumedLicenses = forall a. Maybe a
Prelude.Nothing,
      $sel:description:LicenseConfiguration' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:disassociateWhenNotFound:LicenseConfiguration' :: Maybe Bool
disassociateWhenNotFound = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseConfigurationArn:LicenseConfiguration' :: Maybe Text
licenseConfigurationArn = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseConfigurationId:LicenseConfiguration' :: Maybe Text
licenseConfigurationId = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseCount:LicenseConfiguration' :: Maybe Integer
licenseCount = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseCountHardLimit:LicenseConfiguration' :: Maybe Bool
licenseCountHardLimit = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseCountingType:LicenseConfiguration' :: Maybe LicenseCountingType
licenseCountingType = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseRules:LicenseConfiguration' :: Maybe [Text]
licenseRules = forall a. Maybe a
Prelude.Nothing,
      $sel:managedResourceSummaryList:LicenseConfiguration' :: Maybe [ManagedResourceSummary]
managedResourceSummaryList = forall a. Maybe a
Prelude.Nothing,
      $sel:name:LicenseConfiguration' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:ownerAccountId:LicenseConfiguration' :: Maybe Text
ownerAccountId = forall a. Maybe a
Prelude.Nothing,
      $sel:productInformationList:LicenseConfiguration' :: Maybe [ProductInformation]
productInformationList = forall a. Maybe a
Prelude.Nothing,
      $sel:status:LicenseConfiguration' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | Automated discovery information.
licenseConfiguration_automatedDiscoveryInformation :: Lens.Lens' LicenseConfiguration (Prelude.Maybe AutomatedDiscoveryInformation)
licenseConfiguration_automatedDiscoveryInformation :: Lens' LicenseConfiguration (Maybe AutomatedDiscoveryInformation)
licenseConfiguration_automatedDiscoveryInformation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe AutomatedDiscoveryInformation
automatedDiscoveryInformation :: Maybe AutomatedDiscoveryInformation
$sel:automatedDiscoveryInformation:LicenseConfiguration' :: LicenseConfiguration -> Maybe AutomatedDiscoveryInformation
automatedDiscoveryInformation} -> Maybe AutomatedDiscoveryInformation
automatedDiscoveryInformation) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe AutomatedDiscoveryInformation
a -> LicenseConfiguration
s {$sel:automatedDiscoveryInformation:LicenseConfiguration' :: Maybe AutomatedDiscoveryInformation
automatedDiscoveryInformation = Maybe AutomatedDiscoveryInformation
a} :: LicenseConfiguration)

-- | Summaries for licenses consumed by various resources.
licenseConfiguration_consumedLicenseSummaryList :: Lens.Lens' LicenseConfiguration (Prelude.Maybe [ConsumedLicenseSummary])
licenseConfiguration_consumedLicenseSummaryList :: Lens' LicenseConfiguration (Maybe [ConsumedLicenseSummary])
licenseConfiguration_consumedLicenseSummaryList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe [ConsumedLicenseSummary]
consumedLicenseSummaryList :: Maybe [ConsumedLicenseSummary]
$sel:consumedLicenseSummaryList:LicenseConfiguration' :: LicenseConfiguration -> Maybe [ConsumedLicenseSummary]
consumedLicenseSummaryList} -> Maybe [ConsumedLicenseSummary]
consumedLicenseSummaryList) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe [ConsumedLicenseSummary]
a -> LicenseConfiguration
s {$sel:consumedLicenseSummaryList:LicenseConfiguration' :: Maybe [ConsumedLicenseSummary]
consumedLicenseSummaryList = Maybe [ConsumedLicenseSummary]
a} :: LicenseConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Number of licenses consumed.
licenseConfiguration_consumedLicenses :: Lens.Lens' LicenseConfiguration (Prelude.Maybe Prelude.Integer)
licenseConfiguration_consumedLicenses :: Lens' LicenseConfiguration (Maybe Integer)
licenseConfiguration_consumedLicenses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe Integer
consumedLicenses :: Maybe Integer
$sel:consumedLicenses:LicenseConfiguration' :: LicenseConfiguration -> Maybe Integer
consumedLicenses} -> Maybe Integer
consumedLicenses) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe Integer
a -> LicenseConfiguration
s {$sel:consumedLicenses:LicenseConfiguration' :: Maybe Integer
consumedLicenses = Maybe Integer
a} :: LicenseConfiguration)

-- | Description of the license configuration.
licenseConfiguration_description :: Lens.Lens' LicenseConfiguration (Prelude.Maybe Prelude.Text)
licenseConfiguration_description :: Lens' LicenseConfiguration (Maybe Text)
licenseConfiguration_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe Text
a -> LicenseConfiguration
s {$sel:description:LicenseConfiguration' :: Maybe Text
description = Maybe Text
a} :: LicenseConfiguration)

-- | When true, disassociates a resource when software is uninstalled.
licenseConfiguration_disassociateWhenNotFound :: Lens.Lens' LicenseConfiguration (Prelude.Maybe Prelude.Bool)
licenseConfiguration_disassociateWhenNotFound :: Lens' LicenseConfiguration (Maybe Bool)
licenseConfiguration_disassociateWhenNotFound = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe Bool
disassociateWhenNotFound :: Maybe Bool
$sel:disassociateWhenNotFound:LicenseConfiguration' :: LicenseConfiguration -> Maybe Bool
disassociateWhenNotFound} -> Maybe Bool
disassociateWhenNotFound) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe Bool
a -> LicenseConfiguration
s {$sel:disassociateWhenNotFound:LicenseConfiguration' :: Maybe Bool
disassociateWhenNotFound = Maybe Bool
a} :: LicenseConfiguration)

-- | 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)

-- | Unique ID of the license configuration.
licenseConfiguration_licenseConfigurationId :: Lens.Lens' LicenseConfiguration (Prelude.Maybe Prelude.Text)
licenseConfiguration_licenseConfigurationId :: Lens' LicenseConfiguration (Maybe Text)
licenseConfiguration_licenseConfigurationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe Text
licenseConfigurationId :: Maybe Text
$sel:licenseConfigurationId:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
licenseConfigurationId} -> Maybe Text
licenseConfigurationId) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe Text
a -> LicenseConfiguration
s {$sel:licenseConfigurationId:LicenseConfiguration' :: Maybe Text
licenseConfigurationId = Maybe Text
a} :: LicenseConfiguration)

-- | Number of licenses managed by the license configuration.
licenseConfiguration_licenseCount :: Lens.Lens' LicenseConfiguration (Prelude.Maybe Prelude.Integer)
licenseConfiguration_licenseCount :: Lens' LicenseConfiguration (Maybe Integer)
licenseConfiguration_licenseCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe Integer
licenseCount :: Maybe Integer
$sel:licenseCount:LicenseConfiguration' :: LicenseConfiguration -> Maybe Integer
licenseCount} -> Maybe Integer
licenseCount) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe Integer
a -> LicenseConfiguration
s {$sel:licenseCount:LicenseConfiguration' :: Maybe Integer
licenseCount = Maybe Integer
a} :: LicenseConfiguration)

-- | Number of available licenses as a hard limit.
licenseConfiguration_licenseCountHardLimit :: Lens.Lens' LicenseConfiguration (Prelude.Maybe Prelude.Bool)
licenseConfiguration_licenseCountHardLimit :: Lens' LicenseConfiguration (Maybe Bool)
licenseConfiguration_licenseCountHardLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe Bool
licenseCountHardLimit :: Maybe Bool
$sel:licenseCountHardLimit:LicenseConfiguration' :: LicenseConfiguration -> Maybe Bool
licenseCountHardLimit} -> Maybe Bool
licenseCountHardLimit) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe Bool
a -> LicenseConfiguration
s {$sel:licenseCountHardLimit:LicenseConfiguration' :: Maybe Bool
licenseCountHardLimit = Maybe Bool
a} :: LicenseConfiguration)

-- | Dimension to use to track the license inventory.
licenseConfiguration_licenseCountingType :: Lens.Lens' LicenseConfiguration (Prelude.Maybe LicenseCountingType)
licenseConfiguration_licenseCountingType :: Lens' LicenseConfiguration (Maybe LicenseCountingType)
licenseConfiguration_licenseCountingType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe LicenseCountingType
licenseCountingType :: Maybe LicenseCountingType
$sel:licenseCountingType:LicenseConfiguration' :: LicenseConfiguration -> Maybe LicenseCountingType
licenseCountingType} -> Maybe LicenseCountingType
licenseCountingType) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe LicenseCountingType
a -> LicenseConfiguration
s {$sel:licenseCountingType:LicenseConfiguration' :: Maybe LicenseCountingType
licenseCountingType = Maybe LicenseCountingType
a} :: LicenseConfiguration)

-- | License rules.
licenseConfiguration_licenseRules :: Lens.Lens' LicenseConfiguration (Prelude.Maybe [Prelude.Text])
licenseConfiguration_licenseRules :: Lens' LicenseConfiguration (Maybe [Text])
licenseConfiguration_licenseRules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe [Text]
licenseRules :: Maybe [Text]
$sel:licenseRules:LicenseConfiguration' :: LicenseConfiguration -> Maybe [Text]
licenseRules} -> Maybe [Text]
licenseRules) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe [Text]
a -> LicenseConfiguration
s {$sel:licenseRules:LicenseConfiguration' :: Maybe [Text]
licenseRules = Maybe [Text]
a} :: LicenseConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Summaries for managed resources.
licenseConfiguration_managedResourceSummaryList :: Lens.Lens' LicenseConfiguration (Prelude.Maybe [ManagedResourceSummary])
licenseConfiguration_managedResourceSummaryList :: Lens' LicenseConfiguration (Maybe [ManagedResourceSummary])
licenseConfiguration_managedResourceSummaryList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe [ManagedResourceSummary]
managedResourceSummaryList :: Maybe [ManagedResourceSummary]
$sel:managedResourceSummaryList:LicenseConfiguration' :: LicenseConfiguration -> Maybe [ManagedResourceSummary]
managedResourceSummaryList} -> Maybe [ManagedResourceSummary]
managedResourceSummaryList) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe [ManagedResourceSummary]
a -> LicenseConfiguration
s {$sel:managedResourceSummaryList:LicenseConfiguration' :: Maybe [ManagedResourceSummary]
managedResourceSummaryList = Maybe [ManagedResourceSummary]
a} :: LicenseConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Name of the license configuration.
licenseConfiguration_name :: Lens.Lens' LicenseConfiguration (Prelude.Maybe Prelude.Text)
licenseConfiguration_name :: Lens' LicenseConfiguration (Maybe Text)
licenseConfiguration_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
name} -> Maybe Text
name) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe Text
a -> LicenseConfiguration
s {$sel:name:LicenseConfiguration' :: Maybe Text
name = Maybe Text
a} :: LicenseConfiguration)

-- | Account ID of the license configuration\'s owner.
licenseConfiguration_ownerAccountId :: Lens.Lens' LicenseConfiguration (Prelude.Maybe Prelude.Text)
licenseConfiguration_ownerAccountId :: Lens' LicenseConfiguration (Maybe Text)
licenseConfiguration_ownerAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe Text
ownerAccountId :: Maybe Text
$sel:ownerAccountId:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
ownerAccountId} -> Maybe Text
ownerAccountId) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe Text
a -> LicenseConfiguration
s {$sel:ownerAccountId:LicenseConfiguration' :: Maybe Text
ownerAccountId = Maybe Text
a} :: LicenseConfiguration)

-- | Product information.
licenseConfiguration_productInformationList :: Lens.Lens' LicenseConfiguration (Prelude.Maybe [ProductInformation])
licenseConfiguration_productInformationList :: Lens' LicenseConfiguration (Maybe [ProductInformation])
licenseConfiguration_productInformationList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe [ProductInformation]
productInformationList :: Maybe [ProductInformation]
$sel:productInformationList:LicenseConfiguration' :: LicenseConfiguration -> Maybe [ProductInformation]
productInformationList} -> Maybe [ProductInformation]
productInformationList) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe [ProductInformation]
a -> LicenseConfiguration
s {$sel:productInformationList:LicenseConfiguration' :: Maybe [ProductInformation]
productInformationList = Maybe [ProductInformation]
a} :: LicenseConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Status of the license configuration.
licenseConfiguration_status :: Lens.Lens' LicenseConfiguration (Prelude.Maybe Prelude.Text)
licenseConfiguration_status :: Lens' LicenseConfiguration (Maybe Text)
licenseConfiguration_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfiguration' {Maybe Text
status :: Maybe Text
$sel:status:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
status} -> Maybe Text
status) (\s :: LicenseConfiguration
s@LicenseConfiguration' {} Maybe Text
a -> LicenseConfiguration
s {$sel:status:LicenseConfiguration' :: Maybe Text
status = Maybe Text
a} :: LicenseConfiguration)

instance Data.FromJSON LicenseConfiguration where
  parseJSON :: Value -> Parser LicenseConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LicenseConfiguration"
      ( \Object
x ->
          Maybe AutomatedDiscoveryInformation
-> Maybe [ConsumedLicenseSummary]
-> Maybe Integer
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Bool
-> Maybe LicenseCountingType
-> Maybe [Text]
-> Maybe [ManagedResourceSummary]
-> Maybe Text
-> Maybe Text
-> Maybe [ProductInformation]
-> Maybe Text
-> LicenseConfiguration
LicenseConfiguration'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AutomatedDiscoveryInformation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ConsumedLicenseSummaryList"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ConsumedLicenses")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DisassociateWhenNotFound")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LicenseConfigurationArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LicenseConfigurationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LicenseCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LicenseCountHardLimit")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LicenseCountingType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LicenseRules" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ManagedResourceSummaryList"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OwnerAccountId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProductInformationList"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
      )

instance Prelude.Hashable LicenseConfiguration where
  hashWithSalt :: Int -> LicenseConfiguration -> Int
hashWithSalt Int
_salt LicenseConfiguration' {Maybe Bool
Maybe Integer
Maybe [Text]
Maybe [ProductInformation]
Maybe [ManagedResourceSummary]
Maybe [ConsumedLicenseSummary]
Maybe Text
Maybe AutomatedDiscoveryInformation
Maybe LicenseCountingType
status :: Maybe Text
productInformationList :: Maybe [ProductInformation]
ownerAccountId :: Maybe Text
name :: Maybe Text
managedResourceSummaryList :: Maybe [ManagedResourceSummary]
licenseRules :: Maybe [Text]
licenseCountingType :: Maybe LicenseCountingType
licenseCountHardLimit :: Maybe Bool
licenseCount :: Maybe Integer
licenseConfigurationId :: Maybe Text
licenseConfigurationArn :: Maybe Text
disassociateWhenNotFound :: Maybe Bool
description :: Maybe Text
consumedLicenses :: Maybe Integer
consumedLicenseSummaryList :: Maybe [ConsumedLicenseSummary]
automatedDiscoveryInformation :: Maybe AutomatedDiscoveryInformation
$sel:status:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:productInformationList:LicenseConfiguration' :: LicenseConfiguration -> Maybe [ProductInformation]
$sel:ownerAccountId:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:name:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:managedResourceSummaryList:LicenseConfiguration' :: LicenseConfiguration -> Maybe [ManagedResourceSummary]
$sel:licenseRules:LicenseConfiguration' :: LicenseConfiguration -> Maybe [Text]
$sel:licenseCountingType:LicenseConfiguration' :: LicenseConfiguration -> Maybe LicenseCountingType
$sel:licenseCountHardLimit:LicenseConfiguration' :: LicenseConfiguration -> Maybe Bool
$sel:licenseCount:LicenseConfiguration' :: LicenseConfiguration -> Maybe Integer
$sel:licenseConfigurationId:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:licenseConfigurationArn:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:disassociateWhenNotFound:LicenseConfiguration' :: LicenseConfiguration -> Maybe Bool
$sel:description:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:consumedLicenses:LicenseConfiguration' :: LicenseConfiguration -> Maybe Integer
$sel:consumedLicenseSummaryList:LicenseConfiguration' :: LicenseConfiguration -> Maybe [ConsumedLicenseSummary]
$sel:automatedDiscoveryInformation:LicenseConfiguration' :: LicenseConfiguration -> Maybe AutomatedDiscoveryInformation
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutomatedDiscoveryInformation
automatedDiscoveryInformation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ConsumedLicenseSummary]
consumedLicenseSummaryList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
consumedLicenses
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disassociateWhenNotFound
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
licenseConfigurationArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
licenseConfigurationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
licenseCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
licenseCountHardLimit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LicenseCountingType
licenseCountingType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
licenseRules
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ManagedResourceSummary]
managedResourceSummaryList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownerAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ProductInformation]
productInformationList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status

instance Prelude.NFData LicenseConfiguration where
  rnf :: LicenseConfiguration -> ()
rnf LicenseConfiguration' {Maybe Bool
Maybe Integer
Maybe [Text]
Maybe [ProductInformation]
Maybe [ManagedResourceSummary]
Maybe [ConsumedLicenseSummary]
Maybe Text
Maybe AutomatedDiscoveryInformation
Maybe LicenseCountingType
status :: Maybe Text
productInformationList :: Maybe [ProductInformation]
ownerAccountId :: Maybe Text
name :: Maybe Text
managedResourceSummaryList :: Maybe [ManagedResourceSummary]
licenseRules :: Maybe [Text]
licenseCountingType :: Maybe LicenseCountingType
licenseCountHardLimit :: Maybe Bool
licenseCount :: Maybe Integer
licenseConfigurationId :: Maybe Text
licenseConfigurationArn :: Maybe Text
disassociateWhenNotFound :: Maybe Bool
description :: Maybe Text
consumedLicenses :: Maybe Integer
consumedLicenseSummaryList :: Maybe [ConsumedLicenseSummary]
automatedDiscoveryInformation :: Maybe AutomatedDiscoveryInformation
$sel:status:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:productInformationList:LicenseConfiguration' :: LicenseConfiguration -> Maybe [ProductInformation]
$sel:ownerAccountId:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:name:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:managedResourceSummaryList:LicenseConfiguration' :: LicenseConfiguration -> Maybe [ManagedResourceSummary]
$sel:licenseRules:LicenseConfiguration' :: LicenseConfiguration -> Maybe [Text]
$sel:licenseCountingType:LicenseConfiguration' :: LicenseConfiguration -> Maybe LicenseCountingType
$sel:licenseCountHardLimit:LicenseConfiguration' :: LicenseConfiguration -> Maybe Bool
$sel:licenseCount:LicenseConfiguration' :: LicenseConfiguration -> Maybe Integer
$sel:licenseConfigurationId:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:licenseConfigurationArn:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:disassociateWhenNotFound:LicenseConfiguration' :: LicenseConfiguration -> Maybe Bool
$sel:description:LicenseConfiguration' :: LicenseConfiguration -> Maybe Text
$sel:consumedLicenses:LicenseConfiguration' :: LicenseConfiguration -> Maybe Integer
$sel:consumedLicenseSummaryList:LicenseConfiguration' :: LicenseConfiguration -> Maybe [ConsumedLicenseSummary]
$sel:automatedDiscoveryInformation:LicenseConfiguration' :: LicenseConfiguration -> Maybe AutomatedDiscoveryInformation
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AutomatedDiscoveryInformation
automatedDiscoveryInformation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConsumedLicenseSummary]
consumedLicenseSummaryList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
consumedLicenses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disassociateWhenNotFound
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
licenseConfigurationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
licenseConfigurationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
licenseCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
licenseCountHardLimit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LicenseCountingType
licenseCountingType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
licenseRules
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ManagedResourceSummary]
managedResourceSummaryList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ProductInformation]
productInformationList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status