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