{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 Text
estimatedCost :: Prelude.Maybe Prelude.Text,
UsageTotal -> Maybe UsageType
type' :: Prelude.Maybe UsageType
}
deriving (UsageTotal -> UsageTotal -> Bool
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]
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
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. 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'
{ $sel:currency:UsageTotal' :: Maybe Currency
currency = forall a. Maybe a
Prelude.Nothing,
$sel:estimatedCost:UsageTotal' :: Maybe Text
estimatedCost = forall a. Maybe a
Prelude.Nothing,
$sel:type':UsageTotal' :: Maybe UsageType
type' = forall a. Maybe a
Prelude.Nothing
}
usageTotal_currency :: Lens.Lens' UsageTotal (Prelude.Maybe Currency)
usageTotal_currency :: Lens' UsageTotal (Maybe Currency)
usageTotal_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_estimatedCost :: Lens.Lens' UsageTotal (Prelude.Maybe Prelude.Text)
usageTotal_estimatedCost :: Lens' UsageTotal (Maybe Text)
usageTotal_estimatedCost = 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)
usageTotal_type :: Lens.Lens' UsageTotal (Prelude.Maybe UsageType)
usageTotal_type :: Lens' UsageTotal (Maybe UsageType)
usageTotal_type = 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)
instance Data.FromJSON UsageTotal where
parseJSON :: Value -> Parser UsageTotal
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"UsageTotal"
( \Object
x ->
Maybe Currency -> Maybe Text -> Maybe UsageType -> UsageTotal
UsageTotal'
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
"currency")
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
"estimatedCost")
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
"type")
)
instance Prelude.Hashable UsageTotal where
hashWithSalt :: Int -> UsageTotal -> Int
hashWithSalt Int
_salt UsageTotal' {Maybe Text
Maybe Currency
Maybe UsageType
type' :: Maybe UsageType
estimatedCost :: Maybe Text
currency :: Maybe Currency
$sel:type':UsageTotal' :: UsageTotal -> Maybe UsageType
$sel:estimatedCost:UsageTotal' :: UsageTotal -> Maybe Text
$sel:currency:UsageTotal' :: UsageTotal -> Maybe Currency
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Currency
currency
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
estimatedCost
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UsageType
type'
instance Prelude.NFData UsageTotal where
rnf :: UsageTotal -> ()
rnf UsageTotal' {Maybe Text
Maybe Currency
Maybe UsageType
type' :: Maybe UsageType
estimatedCost :: Maybe Text
currency :: Maybe Currency
$sel:type':UsageTotal' :: UsageTotal -> Maybe UsageType
$sel:estimatedCost:UsageTotal' :: UsageTotal -> Maybe Text
$sel:currency:UsageTotal' :: UsageTotal -> Maybe Currency
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Currency
currency
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
estimatedCost
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UsageType
type'