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