{-# 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 #-}
module Amazonka.LicenseManager.Types.LicenseConfigurationUsage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LicenseManager.Types.ResourceType
import qualified Amazonka.Prelude as Prelude
data LicenseConfigurationUsage = LicenseConfigurationUsage'
{
LicenseConfigurationUsage -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
LicenseConfigurationUsage -> Maybe Text
resourceStatus :: Prelude.Maybe Prelude.Text,
LicenseConfigurationUsage -> Maybe POSIX
associationTime :: Prelude.Maybe Core.POSIX,
LicenseConfigurationUsage -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
LicenseConfigurationUsage -> Maybe Integer
consumedLicenses :: Prelude.Maybe Prelude.Integer,
LicenseConfigurationUsage -> Maybe Text
resourceOwnerId :: Prelude.Maybe Prelude.Text
}
deriving (LicenseConfigurationUsage -> LicenseConfigurationUsage -> Bool
(LicenseConfigurationUsage -> LicenseConfigurationUsage -> Bool)
-> (LicenseConfigurationUsage -> LicenseConfigurationUsage -> Bool)
-> Eq LicenseConfigurationUsage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LicenseConfigurationUsage -> LicenseConfigurationUsage -> Bool
$c/= :: LicenseConfigurationUsage -> LicenseConfigurationUsage -> Bool
== :: LicenseConfigurationUsage -> LicenseConfigurationUsage -> Bool
$c== :: LicenseConfigurationUsage -> LicenseConfigurationUsage -> Bool
Prelude.Eq, ReadPrec [LicenseConfigurationUsage]
ReadPrec LicenseConfigurationUsage
Int -> ReadS LicenseConfigurationUsage
ReadS [LicenseConfigurationUsage]
(Int -> ReadS LicenseConfigurationUsage)
-> ReadS [LicenseConfigurationUsage]
-> ReadPrec LicenseConfigurationUsage
-> ReadPrec [LicenseConfigurationUsage]
-> Read LicenseConfigurationUsage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LicenseConfigurationUsage]
$creadListPrec :: ReadPrec [LicenseConfigurationUsage]
readPrec :: ReadPrec LicenseConfigurationUsage
$creadPrec :: ReadPrec LicenseConfigurationUsage
readList :: ReadS [LicenseConfigurationUsage]
$creadList :: ReadS [LicenseConfigurationUsage]
readsPrec :: Int -> ReadS LicenseConfigurationUsage
$creadsPrec :: Int -> ReadS LicenseConfigurationUsage
Prelude.Read, Int -> LicenseConfigurationUsage -> ShowS
[LicenseConfigurationUsage] -> ShowS
LicenseConfigurationUsage -> String
(Int -> LicenseConfigurationUsage -> ShowS)
-> (LicenseConfigurationUsage -> String)
-> ([LicenseConfigurationUsage] -> ShowS)
-> Show LicenseConfigurationUsage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LicenseConfigurationUsage] -> ShowS
$cshowList :: [LicenseConfigurationUsage] -> ShowS
show :: LicenseConfigurationUsage -> String
$cshow :: LicenseConfigurationUsage -> String
showsPrec :: Int -> LicenseConfigurationUsage -> ShowS
$cshowsPrec :: Int -> LicenseConfigurationUsage -> ShowS
Prelude.Show, (forall x.
LicenseConfigurationUsage -> Rep LicenseConfigurationUsage x)
-> (forall x.
Rep LicenseConfigurationUsage x -> LicenseConfigurationUsage)
-> Generic LicenseConfigurationUsage
forall x.
Rep LicenseConfigurationUsage x -> LicenseConfigurationUsage
forall x.
LicenseConfigurationUsage -> Rep LicenseConfigurationUsage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LicenseConfigurationUsage x -> LicenseConfigurationUsage
$cfrom :: forall x.
LicenseConfigurationUsage -> Rep LicenseConfigurationUsage x
Prelude.Generic)
newLicenseConfigurationUsage ::
LicenseConfigurationUsage
newLicenseConfigurationUsage :: LicenseConfigurationUsage
newLicenseConfigurationUsage =
LicenseConfigurationUsage' :: Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> LicenseConfigurationUsage
LicenseConfigurationUsage'
{ $sel:resourceType:LicenseConfigurationUsage' :: Maybe ResourceType
resourceType =
Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
$sel:resourceStatus:LicenseConfigurationUsage' :: Maybe Text
resourceStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:associationTime:LicenseConfigurationUsage' :: Maybe POSIX
associationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:LicenseConfigurationUsage' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:consumedLicenses:LicenseConfigurationUsage' :: Maybe Integer
consumedLicenses = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:resourceOwnerId:LicenseConfigurationUsage' :: Maybe Text
resourceOwnerId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
licenseConfigurationUsage_resourceType :: Lens.Lens' LicenseConfigurationUsage (Prelude.Maybe ResourceType)
licenseConfigurationUsage_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> LicenseConfigurationUsage -> f LicenseConfigurationUsage
licenseConfigurationUsage_resourceType = (LicenseConfigurationUsage -> Maybe ResourceType)
-> (LicenseConfigurationUsage
-> Maybe ResourceType -> LicenseConfigurationUsage)
-> Lens
LicenseConfigurationUsage
LicenseConfigurationUsage
(Maybe ResourceType)
(Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfigurationUsage' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:LicenseConfigurationUsage' :: LicenseConfigurationUsage -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: LicenseConfigurationUsage
s@LicenseConfigurationUsage' {} Maybe ResourceType
a -> LicenseConfigurationUsage
s {$sel:resourceType:LicenseConfigurationUsage' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: LicenseConfigurationUsage)
licenseConfigurationUsage_resourceStatus :: Lens.Lens' LicenseConfigurationUsage (Prelude.Maybe Prelude.Text)
licenseConfigurationUsage_resourceStatus :: (Maybe Text -> f (Maybe Text))
-> LicenseConfigurationUsage -> f LicenseConfigurationUsage
licenseConfigurationUsage_resourceStatus = (LicenseConfigurationUsage -> Maybe Text)
-> (LicenseConfigurationUsage
-> Maybe Text -> LicenseConfigurationUsage)
-> Lens
LicenseConfigurationUsage
LicenseConfigurationUsage
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfigurationUsage' {Maybe Text
resourceStatus :: Maybe Text
$sel:resourceStatus:LicenseConfigurationUsage' :: LicenseConfigurationUsage -> Maybe Text
resourceStatus} -> Maybe Text
resourceStatus) (\s :: LicenseConfigurationUsage
s@LicenseConfigurationUsage' {} Maybe Text
a -> LicenseConfigurationUsage
s {$sel:resourceStatus:LicenseConfigurationUsage' :: Maybe Text
resourceStatus = Maybe Text
a} :: LicenseConfigurationUsage)
licenseConfigurationUsage_associationTime :: Lens.Lens' LicenseConfigurationUsage (Prelude.Maybe Prelude.UTCTime)
licenseConfigurationUsage_associationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LicenseConfigurationUsage -> f LicenseConfigurationUsage
licenseConfigurationUsage_associationTime = (LicenseConfigurationUsage -> Maybe POSIX)
-> (LicenseConfigurationUsage
-> Maybe POSIX -> LicenseConfigurationUsage)
-> Lens
LicenseConfigurationUsage
LicenseConfigurationUsage
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfigurationUsage' {Maybe POSIX
associationTime :: Maybe POSIX
$sel:associationTime:LicenseConfigurationUsage' :: LicenseConfigurationUsage -> Maybe POSIX
associationTime} -> Maybe POSIX
associationTime) (\s :: LicenseConfigurationUsage
s@LicenseConfigurationUsage' {} Maybe POSIX
a -> LicenseConfigurationUsage
s {$sel:associationTime:LicenseConfigurationUsage' :: Maybe POSIX
associationTime = Maybe POSIX
a} :: LicenseConfigurationUsage) ((Maybe POSIX -> f (Maybe POSIX))
-> LicenseConfigurationUsage -> f LicenseConfigurationUsage)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LicenseConfigurationUsage
-> f LicenseConfigurationUsage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
licenseConfigurationUsage_resourceArn :: Lens.Lens' LicenseConfigurationUsage (Prelude.Maybe Prelude.Text)
licenseConfigurationUsage_resourceArn :: (Maybe Text -> f (Maybe Text))
-> LicenseConfigurationUsage -> f LicenseConfigurationUsage
licenseConfigurationUsage_resourceArn = (LicenseConfigurationUsage -> Maybe Text)
-> (LicenseConfigurationUsage
-> Maybe Text -> LicenseConfigurationUsage)
-> Lens
LicenseConfigurationUsage
LicenseConfigurationUsage
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfigurationUsage' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:LicenseConfigurationUsage' :: LicenseConfigurationUsage -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: LicenseConfigurationUsage
s@LicenseConfigurationUsage' {} Maybe Text
a -> LicenseConfigurationUsage
s {$sel:resourceArn:LicenseConfigurationUsage' :: Maybe Text
resourceArn = Maybe Text
a} :: LicenseConfigurationUsage)
licenseConfigurationUsage_consumedLicenses :: Lens.Lens' LicenseConfigurationUsage (Prelude.Maybe Prelude.Integer)
licenseConfigurationUsage_consumedLicenses :: (Maybe Integer -> f (Maybe Integer))
-> LicenseConfigurationUsage -> f LicenseConfigurationUsage
licenseConfigurationUsage_consumedLicenses = (LicenseConfigurationUsage -> Maybe Integer)
-> (LicenseConfigurationUsage
-> Maybe Integer -> LicenseConfigurationUsage)
-> Lens
LicenseConfigurationUsage
LicenseConfigurationUsage
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfigurationUsage' {Maybe Integer
consumedLicenses :: Maybe Integer
$sel:consumedLicenses:LicenseConfigurationUsage' :: LicenseConfigurationUsage -> Maybe Integer
consumedLicenses} -> Maybe Integer
consumedLicenses) (\s :: LicenseConfigurationUsage
s@LicenseConfigurationUsage' {} Maybe Integer
a -> LicenseConfigurationUsage
s {$sel:consumedLicenses:LicenseConfigurationUsage' :: Maybe Integer
consumedLicenses = Maybe Integer
a} :: LicenseConfigurationUsage)
licenseConfigurationUsage_resourceOwnerId :: Lens.Lens' LicenseConfigurationUsage (Prelude.Maybe Prelude.Text)
licenseConfigurationUsage_resourceOwnerId :: (Maybe Text -> f (Maybe Text))
-> LicenseConfigurationUsage -> f LicenseConfigurationUsage
licenseConfigurationUsage_resourceOwnerId = (LicenseConfigurationUsage -> Maybe Text)
-> (LicenseConfigurationUsage
-> Maybe Text -> LicenseConfigurationUsage)
-> Lens
LicenseConfigurationUsage
LicenseConfigurationUsage
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LicenseConfigurationUsage' {Maybe Text
resourceOwnerId :: Maybe Text
$sel:resourceOwnerId:LicenseConfigurationUsage' :: LicenseConfigurationUsage -> Maybe Text
resourceOwnerId} -> Maybe Text
resourceOwnerId) (\s :: LicenseConfigurationUsage
s@LicenseConfigurationUsage' {} Maybe Text
a -> LicenseConfigurationUsage
s {$sel:resourceOwnerId:LicenseConfigurationUsage' :: Maybe Text
resourceOwnerId = Maybe Text
a} :: LicenseConfigurationUsage)
instance Core.FromJSON LicenseConfigurationUsage where
parseJSON :: Value -> Parser LicenseConfigurationUsage
parseJSON =
String
-> (Object -> Parser LicenseConfigurationUsage)
-> Value
-> Parser LicenseConfigurationUsage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LicenseConfigurationUsage"
( \Object
x ->
Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> LicenseConfigurationUsage
LicenseConfigurationUsage'
(Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> LicenseConfigurationUsage)
-> Parser (Maybe ResourceType)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> LicenseConfigurationUsage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceType")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> LicenseConfigurationUsage)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> LicenseConfigurationUsage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceStatus")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> LicenseConfigurationUsage)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Integer -> Maybe Text -> LicenseConfigurationUsage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssociationTime")
Parser
(Maybe Text
-> Maybe Integer -> Maybe Text -> LicenseConfigurationUsage)
-> Parser (Maybe Text)
-> Parser
(Maybe Integer -> Maybe Text -> LicenseConfigurationUsage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceArn")
Parser (Maybe Integer -> Maybe Text -> LicenseConfigurationUsage)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> LicenseConfigurationUsage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConsumedLicenses")
Parser (Maybe Text -> LicenseConfigurationUsage)
-> Parser (Maybe Text) -> Parser LicenseConfigurationUsage
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceOwnerId")
)
instance Prelude.Hashable LicenseConfigurationUsage
instance Prelude.NFData LicenseConfigurationUsage