{-# 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.MacieV2.Types.UsageByAccount where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.Currency
import Amazonka.MacieV2.Types.ServiceLimit
import Amazonka.MacieV2.Types.UsageType
import qualified Amazonka.Prelude as Prelude
data UsageByAccount = UsageByAccount'
{
UsageByAccount -> Maybe ServiceLimit
serviceLimit :: Prelude.Maybe ServiceLimit,
UsageByAccount -> Maybe Currency
currency :: Prelude.Maybe Currency,
UsageByAccount -> Maybe UsageType
type' :: Prelude.Maybe UsageType,
UsageByAccount -> Maybe Text
estimatedCost :: Prelude.Maybe Prelude.Text
}
deriving (UsageByAccount -> UsageByAccount -> Bool
(UsageByAccount -> UsageByAccount -> Bool)
-> (UsageByAccount -> UsageByAccount -> Bool) -> Eq UsageByAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UsageByAccount -> UsageByAccount -> Bool
$c/= :: UsageByAccount -> UsageByAccount -> Bool
== :: UsageByAccount -> UsageByAccount -> Bool
$c== :: UsageByAccount -> UsageByAccount -> Bool
Prelude.Eq, ReadPrec [UsageByAccount]
ReadPrec UsageByAccount
Int -> ReadS UsageByAccount
ReadS [UsageByAccount]
(Int -> ReadS UsageByAccount)
-> ReadS [UsageByAccount]
-> ReadPrec UsageByAccount
-> ReadPrec [UsageByAccount]
-> Read UsageByAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UsageByAccount]
$creadListPrec :: ReadPrec [UsageByAccount]
readPrec :: ReadPrec UsageByAccount
$creadPrec :: ReadPrec UsageByAccount
readList :: ReadS [UsageByAccount]
$creadList :: ReadS [UsageByAccount]
readsPrec :: Int -> ReadS UsageByAccount
$creadsPrec :: Int -> ReadS UsageByAccount
Prelude.Read, Int -> UsageByAccount -> ShowS
[UsageByAccount] -> ShowS
UsageByAccount -> String
(Int -> UsageByAccount -> ShowS)
-> (UsageByAccount -> String)
-> ([UsageByAccount] -> ShowS)
-> Show UsageByAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UsageByAccount] -> ShowS
$cshowList :: [UsageByAccount] -> ShowS
show :: UsageByAccount -> String
$cshow :: UsageByAccount -> String
showsPrec :: Int -> UsageByAccount -> ShowS
$cshowsPrec :: Int -> UsageByAccount -> ShowS
Prelude.Show, (forall x. UsageByAccount -> Rep UsageByAccount x)
-> (forall x. Rep UsageByAccount x -> UsageByAccount)
-> Generic UsageByAccount
forall x. Rep UsageByAccount x -> UsageByAccount
forall x. UsageByAccount -> Rep UsageByAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UsageByAccount x -> UsageByAccount
$cfrom :: forall x. UsageByAccount -> Rep UsageByAccount x
Prelude.Generic)
newUsageByAccount ::
UsageByAccount
newUsageByAccount :: UsageByAccount
newUsageByAccount =
UsageByAccount' :: Maybe ServiceLimit
-> Maybe Currency
-> Maybe UsageType
-> Maybe Text
-> UsageByAccount
UsageByAccount'
{ $sel:serviceLimit:UsageByAccount' :: Maybe ServiceLimit
serviceLimit = Maybe ServiceLimit
forall a. Maybe a
Prelude.Nothing,
$sel:currency:UsageByAccount' :: Maybe Currency
currency = Maybe Currency
forall a. Maybe a
Prelude.Nothing,
$sel:type':UsageByAccount' :: Maybe UsageType
type' = Maybe UsageType
forall a. Maybe a
Prelude.Nothing,
$sel:estimatedCost:UsageByAccount' :: Maybe Text
estimatedCost = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
usageByAccount_serviceLimit :: Lens.Lens' UsageByAccount (Prelude.Maybe ServiceLimit)
usageByAccount_serviceLimit :: (Maybe ServiceLimit -> f (Maybe ServiceLimit))
-> UsageByAccount -> f UsageByAccount
usageByAccount_serviceLimit = (UsageByAccount -> Maybe ServiceLimit)
-> (UsageByAccount -> Maybe ServiceLimit -> UsageByAccount)
-> Lens
UsageByAccount
UsageByAccount
(Maybe ServiceLimit)
(Maybe ServiceLimit)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageByAccount' {Maybe ServiceLimit
serviceLimit :: Maybe ServiceLimit
$sel:serviceLimit:UsageByAccount' :: UsageByAccount -> Maybe ServiceLimit
serviceLimit} -> Maybe ServiceLimit
serviceLimit) (\s :: UsageByAccount
s@UsageByAccount' {} Maybe ServiceLimit
a -> UsageByAccount
s {$sel:serviceLimit:UsageByAccount' :: Maybe ServiceLimit
serviceLimit = Maybe ServiceLimit
a} :: UsageByAccount)
usageByAccount_currency :: Lens.Lens' UsageByAccount (Prelude.Maybe Currency)
usageByAccount_currency :: (Maybe Currency -> f (Maybe Currency))
-> UsageByAccount -> f UsageByAccount
usageByAccount_currency = (UsageByAccount -> Maybe Currency)
-> (UsageByAccount -> Maybe Currency -> UsageByAccount)
-> Lens
UsageByAccount UsageByAccount (Maybe Currency) (Maybe Currency)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageByAccount' {Maybe Currency
currency :: Maybe Currency
$sel:currency:UsageByAccount' :: UsageByAccount -> Maybe Currency
currency} -> Maybe Currency
currency) (\s :: UsageByAccount
s@UsageByAccount' {} Maybe Currency
a -> UsageByAccount
s {$sel:currency:UsageByAccount' :: Maybe Currency
currency = Maybe Currency
a} :: UsageByAccount)
usageByAccount_type :: Lens.Lens' UsageByAccount (Prelude.Maybe UsageType)
usageByAccount_type :: (Maybe UsageType -> f (Maybe UsageType))
-> UsageByAccount -> f UsageByAccount
usageByAccount_type = (UsageByAccount -> Maybe UsageType)
-> (UsageByAccount -> Maybe UsageType -> UsageByAccount)
-> Lens
UsageByAccount UsageByAccount (Maybe UsageType) (Maybe UsageType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageByAccount' {Maybe UsageType
type' :: Maybe UsageType
$sel:type':UsageByAccount' :: UsageByAccount -> Maybe UsageType
type'} -> Maybe UsageType
type') (\s :: UsageByAccount
s@UsageByAccount' {} Maybe UsageType
a -> UsageByAccount
s {$sel:type':UsageByAccount' :: Maybe UsageType
type' = Maybe UsageType
a} :: UsageByAccount)
usageByAccount_estimatedCost :: Lens.Lens' UsageByAccount (Prelude.Maybe Prelude.Text)
usageByAccount_estimatedCost :: (Maybe Text -> f (Maybe Text))
-> UsageByAccount -> f UsageByAccount
usageByAccount_estimatedCost = (UsageByAccount -> Maybe Text)
-> (UsageByAccount -> Maybe Text -> UsageByAccount)
-> Lens UsageByAccount UsageByAccount (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageByAccount' {Maybe Text
estimatedCost :: Maybe Text
$sel:estimatedCost:UsageByAccount' :: UsageByAccount -> Maybe Text
estimatedCost} -> Maybe Text
estimatedCost) (\s :: UsageByAccount
s@UsageByAccount' {} Maybe Text
a -> UsageByAccount
s {$sel:estimatedCost:UsageByAccount' :: Maybe Text
estimatedCost = Maybe Text
a} :: UsageByAccount)
instance Core.FromJSON UsageByAccount where
parseJSON :: Value -> Parser UsageByAccount
parseJSON =
String
-> (Object -> Parser UsageByAccount)
-> Value
-> Parser UsageByAccount
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UsageByAccount"
( \Object
x ->
Maybe ServiceLimit
-> Maybe Currency
-> Maybe UsageType
-> Maybe Text
-> UsageByAccount
UsageByAccount'
(Maybe ServiceLimit
-> Maybe Currency
-> Maybe UsageType
-> Maybe Text
-> UsageByAccount)
-> Parser (Maybe ServiceLimit)
-> Parser
(Maybe Currency -> Maybe UsageType -> Maybe Text -> UsageByAccount)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ServiceLimit)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serviceLimit")
Parser
(Maybe Currency -> Maybe UsageType -> Maybe Text -> UsageByAccount)
-> Parser (Maybe Currency)
-> Parser (Maybe UsageType -> Maybe Text -> UsageByAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Currency)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"currency")
Parser (Maybe UsageType -> Maybe Text -> UsageByAccount)
-> Parser (Maybe UsageType)
-> Parser (Maybe Text -> UsageByAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UsageType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
Parser (Maybe Text -> UsageByAccount)
-> Parser (Maybe Text) -> Parser UsageByAccount
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
"estimatedCost")
)
instance Prelude.Hashable UsageByAccount
instance Prelude.NFData UsageByAccount