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