{-# 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.Lambda.Types.AccountUsage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AccountUsage = AccountUsage'
{
AccountUsage -> Maybe Integer
totalCodeSize :: Prelude.Maybe Prelude.Integer,
AccountUsage -> Maybe Integer
functionCount :: Prelude.Maybe Prelude.Integer
}
deriving (AccountUsage -> AccountUsage -> Bool
(AccountUsage -> AccountUsage -> Bool)
-> (AccountUsage -> AccountUsage -> Bool) -> Eq AccountUsage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountUsage -> AccountUsage -> Bool
$c/= :: AccountUsage -> AccountUsage -> Bool
== :: AccountUsage -> AccountUsage -> Bool
$c== :: AccountUsage -> AccountUsage -> Bool
Prelude.Eq, ReadPrec [AccountUsage]
ReadPrec AccountUsage
Int -> ReadS AccountUsage
ReadS [AccountUsage]
(Int -> ReadS AccountUsage)
-> ReadS [AccountUsage]
-> ReadPrec AccountUsage
-> ReadPrec [AccountUsage]
-> Read AccountUsage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountUsage]
$creadListPrec :: ReadPrec [AccountUsage]
readPrec :: ReadPrec AccountUsage
$creadPrec :: ReadPrec AccountUsage
readList :: ReadS [AccountUsage]
$creadList :: ReadS [AccountUsage]
readsPrec :: Int -> ReadS AccountUsage
$creadsPrec :: Int -> ReadS AccountUsage
Prelude.Read, Int -> AccountUsage -> ShowS
[AccountUsage] -> ShowS
AccountUsage -> String
(Int -> AccountUsage -> ShowS)
-> (AccountUsage -> String)
-> ([AccountUsage] -> ShowS)
-> Show AccountUsage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountUsage] -> ShowS
$cshowList :: [AccountUsage] -> ShowS
show :: AccountUsage -> String
$cshow :: AccountUsage -> String
showsPrec :: Int -> AccountUsage -> ShowS
$cshowsPrec :: Int -> AccountUsage -> ShowS
Prelude.Show, (forall x. AccountUsage -> Rep AccountUsage x)
-> (forall x. Rep AccountUsage x -> AccountUsage)
-> Generic AccountUsage
forall x. Rep AccountUsage x -> AccountUsage
forall x. AccountUsage -> Rep AccountUsage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountUsage x -> AccountUsage
$cfrom :: forall x. AccountUsage -> Rep AccountUsage x
Prelude.Generic)
newAccountUsage ::
AccountUsage
newAccountUsage :: AccountUsage
newAccountUsage =
AccountUsage' :: Maybe Integer -> Maybe Integer -> AccountUsage
AccountUsage'
{ $sel:totalCodeSize:AccountUsage' :: Maybe Integer
totalCodeSize = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:functionCount:AccountUsage' :: Maybe Integer
functionCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
accountUsage_totalCodeSize :: Lens.Lens' AccountUsage (Prelude.Maybe Prelude.Integer)
accountUsage_totalCodeSize :: (Maybe Integer -> f (Maybe Integer))
-> AccountUsage -> f AccountUsage
accountUsage_totalCodeSize = (AccountUsage -> Maybe Integer)
-> (AccountUsage -> Maybe Integer -> AccountUsage)
-> Lens AccountUsage AccountUsage (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountUsage' {Maybe Integer
totalCodeSize :: Maybe Integer
$sel:totalCodeSize:AccountUsage' :: AccountUsage -> Maybe Integer
totalCodeSize} -> Maybe Integer
totalCodeSize) (\s :: AccountUsage
s@AccountUsage' {} Maybe Integer
a -> AccountUsage
s {$sel:totalCodeSize:AccountUsage' :: Maybe Integer
totalCodeSize = Maybe Integer
a} :: AccountUsage)
accountUsage_functionCount :: Lens.Lens' AccountUsage (Prelude.Maybe Prelude.Integer)
accountUsage_functionCount :: (Maybe Integer -> f (Maybe Integer))
-> AccountUsage -> f AccountUsage
accountUsage_functionCount = (AccountUsage -> Maybe Integer)
-> (AccountUsage -> Maybe Integer -> AccountUsage)
-> Lens AccountUsage AccountUsage (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountUsage' {Maybe Integer
functionCount :: Maybe Integer
$sel:functionCount:AccountUsage' :: AccountUsage -> Maybe Integer
functionCount} -> Maybe Integer
functionCount) (\s :: AccountUsage
s@AccountUsage' {} Maybe Integer
a -> AccountUsage
s {$sel:functionCount:AccountUsage' :: Maybe Integer
functionCount = Maybe Integer
a} :: AccountUsage)
instance Core.FromJSON AccountUsage where
parseJSON :: Value -> Parser AccountUsage
parseJSON =
String
-> (Object -> Parser AccountUsage) -> Value -> Parser AccountUsage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AccountUsage"
( \Object
x ->
Maybe Integer -> Maybe Integer -> AccountUsage
AccountUsage'
(Maybe Integer -> Maybe Integer -> AccountUsage)
-> Parser (Maybe Integer) -> Parser (Maybe Integer -> AccountUsage)
forall (f :: * -> *) a b. Functor 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
"TotalCodeSize")
Parser (Maybe Integer -> AccountUsage)
-> Parser (Maybe Integer) -> Parser AccountUsage
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
"FunctionCount")
)
instance Prelude.Hashable AccountUsage
instance Prelude.NFData AccountUsage