{-# 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.S3.Types.Stats where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data Stats = Stats'
{
Stats -> Maybe Integer
bytesReturned :: Prelude.Maybe Prelude.Integer,
Stats -> Maybe Integer
bytesScanned :: Prelude.Maybe Prelude.Integer,
Stats -> Maybe Integer
bytesProcessed :: Prelude.Maybe Prelude.Integer
}
deriving (Stats -> Stats -> Bool
(Stats -> Stats -> Bool) -> (Stats -> Stats -> Bool) -> Eq Stats
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Stats -> Stats -> Bool
$c/= :: Stats -> Stats -> Bool
== :: Stats -> Stats -> Bool
$c== :: Stats -> Stats -> Bool
Prelude.Eq, ReadPrec [Stats]
ReadPrec Stats
Int -> ReadS Stats
ReadS [Stats]
(Int -> ReadS Stats)
-> ReadS [Stats]
-> ReadPrec Stats
-> ReadPrec [Stats]
-> Read Stats
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Stats]
$creadListPrec :: ReadPrec [Stats]
readPrec :: ReadPrec Stats
$creadPrec :: ReadPrec Stats
readList :: ReadS [Stats]
$creadList :: ReadS [Stats]
readsPrec :: Int -> ReadS Stats
$creadsPrec :: Int -> ReadS Stats
Prelude.Read, Int -> Stats -> ShowS
[Stats] -> ShowS
Stats -> String
(Int -> Stats -> ShowS)
-> (Stats -> String) -> ([Stats] -> ShowS) -> Show Stats
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Stats] -> ShowS
$cshowList :: [Stats] -> ShowS
show :: Stats -> String
$cshow :: Stats -> String
showsPrec :: Int -> Stats -> ShowS
$cshowsPrec :: Int -> Stats -> ShowS
Prelude.Show, (forall x. Stats -> Rep Stats x)
-> (forall x. Rep Stats x -> Stats) -> Generic Stats
forall x. Rep Stats x -> Stats
forall x. Stats -> Rep Stats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Stats x -> Stats
$cfrom :: forall x. Stats -> Rep Stats x
Prelude.Generic)
newStats ::
Stats
newStats :: Stats
newStats =
Stats' :: Maybe Integer -> Maybe Integer -> Maybe Integer -> Stats
Stats'
{ $sel:bytesReturned:Stats' :: Maybe Integer
bytesReturned = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:bytesScanned:Stats' :: Maybe Integer
bytesScanned = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:bytesProcessed:Stats' :: Maybe Integer
bytesProcessed = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
stats_bytesReturned :: Lens.Lens' Stats (Prelude.Maybe Prelude.Integer)
stats_bytesReturned :: (Maybe Integer -> f (Maybe Integer)) -> Stats -> f Stats
stats_bytesReturned = (Stats -> Maybe Integer)
-> (Stats -> Maybe Integer -> Stats)
-> Lens Stats Stats (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stats' {Maybe Integer
bytesReturned :: Maybe Integer
$sel:bytesReturned:Stats' :: Stats -> Maybe Integer
bytesReturned} -> Maybe Integer
bytesReturned) (\s :: Stats
s@Stats' {} Maybe Integer
a -> Stats
s {$sel:bytesReturned:Stats' :: Maybe Integer
bytesReturned = Maybe Integer
a} :: Stats)
stats_bytesScanned :: Lens.Lens' Stats (Prelude.Maybe Prelude.Integer)
stats_bytesScanned :: (Maybe Integer -> f (Maybe Integer)) -> Stats -> f Stats
stats_bytesScanned = (Stats -> Maybe Integer)
-> (Stats -> Maybe Integer -> Stats)
-> Lens Stats Stats (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stats' {Maybe Integer
bytesScanned :: Maybe Integer
$sel:bytesScanned:Stats' :: Stats -> Maybe Integer
bytesScanned} -> Maybe Integer
bytesScanned) (\s :: Stats
s@Stats' {} Maybe Integer
a -> Stats
s {$sel:bytesScanned:Stats' :: Maybe Integer
bytesScanned = Maybe Integer
a} :: Stats)
stats_bytesProcessed :: Lens.Lens' Stats (Prelude.Maybe Prelude.Integer)
stats_bytesProcessed :: (Maybe Integer -> f (Maybe Integer)) -> Stats -> f Stats
stats_bytesProcessed = (Stats -> Maybe Integer)
-> (Stats -> Maybe Integer -> Stats)
-> Lens Stats Stats (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Stats' {Maybe Integer
bytesProcessed :: Maybe Integer
$sel:bytesProcessed:Stats' :: Stats -> Maybe Integer
bytesProcessed} -> Maybe Integer
bytesProcessed) (\s :: Stats
s@Stats' {} Maybe Integer
a -> Stats
s {$sel:bytesProcessed:Stats' :: Maybe Integer
bytesProcessed = Maybe Integer
a} :: Stats)
instance Core.FromXML Stats where
parseXML :: [Node] -> Either String Stats
parseXML [Node]
x =
Maybe Integer -> Maybe Integer -> Maybe Integer -> Stats
Stats'
(Maybe Integer -> Maybe Integer -> Maybe Integer -> Stats)
-> Either String (Maybe Integer)
-> Either String (Maybe Integer -> Maybe Integer -> Stats)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"BytesReturned")
Either String (Maybe Integer -> Maybe Integer -> Stats)
-> Either String (Maybe Integer)
-> Either String (Maybe Integer -> Stats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"BytesScanned")
Either String (Maybe Integer -> Stats)
-> Either String (Maybe Integer) -> Either String Stats
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"BytesProcessed")
instance Prelude.Hashable Stats
instance Prelude.NFData Stats