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