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