{-# 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.Snowball.Types.DataTransfer where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DataTransfer = DataTransfer'
{
DataTransfer -> Maybe Integer
totalObjects :: Prelude.Maybe Prelude.Integer,
DataTransfer -> Maybe Integer
totalBytes :: Prelude.Maybe Prelude.Integer,
DataTransfer -> Maybe Integer
objectsTransferred :: Prelude.Maybe Prelude.Integer,
DataTransfer -> Maybe Integer
bytesTransferred :: Prelude.Maybe Prelude.Integer
}
deriving (DataTransfer -> DataTransfer -> Bool
(DataTransfer -> DataTransfer -> Bool)
-> (DataTransfer -> DataTransfer -> Bool) -> Eq DataTransfer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataTransfer -> DataTransfer -> Bool
$c/= :: DataTransfer -> DataTransfer -> Bool
== :: DataTransfer -> DataTransfer -> Bool
$c== :: DataTransfer -> DataTransfer -> Bool
Prelude.Eq, ReadPrec [DataTransfer]
ReadPrec DataTransfer
Int -> ReadS DataTransfer
ReadS [DataTransfer]
(Int -> ReadS DataTransfer)
-> ReadS [DataTransfer]
-> ReadPrec DataTransfer
-> ReadPrec [DataTransfer]
-> Read DataTransfer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataTransfer]
$creadListPrec :: ReadPrec [DataTransfer]
readPrec :: ReadPrec DataTransfer
$creadPrec :: ReadPrec DataTransfer
readList :: ReadS [DataTransfer]
$creadList :: ReadS [DataTransfer]
readsPrec :: Int -> ReadS DataTransfer
$creadsPrec :: Int -> ReadS DataTransfer
Prelude.Read, Int -> DataTransfer -> ShowS
[DataTransfer] -> ShowS
DataTransfer -> String
(Int -> DataTransfer -> ShowS)
-> (DataTransfer -> String)
-> ([DataTransfer] -> ShowS)
-> Show DataTransfer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataTransfer] -> ShowS
$cshowList :: [DataTransfer] -> ShowS
show :: DataTransfer -> String
$cshow :: DataTransfer -> String
showsPrec :: Int -> DataTransfer -> ShowS
$cshowsPrec :: Int -> DataTransfer -> ShowS
Prelude.Show, (forall x. DataTransfer -> Rep DataTransfer x)
-> (forall x. Rep DataTransfer x -> DataTransfer)
-> Generic DataTransfer
forall x. Rep DataTransfer x -> DataTransfer
forall x. DataTransfer -> Rep DataTransfer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataTransfer x -> DataTransfer
$cfrom :: forall x. DataTransfer -> Rep DataTransfer x
Prelude.Generic)
newDataTransfer ::
DataTransfer
newDataTransfer :: DataTransfer
newDataTransfer =
DataTransfer' :: Maybe Integer
-> Maybe Integer -> Maybe Integer -> Maybe Integer -> DataTransfer
DataTransfer'
{ $sel:totalObjects:DataTransfer' :: Maybe Integer
totalObjects = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:totalBytes:DataTransfer' :: Maybe Integer
totalBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:objectsTransferred:DataTransfer' :: Maybe Integer
objectsTransferred = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:bytesTransferred:DataTransfer' :: Maybe Integer
bytesTransferred = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
dataTransfer_totalObjects :: Lens.Lens' DataTransfer (Prelude.Maybe Prelude.Integer)
dataTransfer_totalObjects :: (Maybe Integer -> f (Maybe Integer))
-> DataTransfer -> f DataTransfer
dataTransfer_totalObjects = (DataTransfer -> Maybe Integer)
-> (DataTransfer -> Maybe Integer -> DataTransfer)
-> Lens DataTransfer DataTransfer (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataTransfer' {Maybe Integer
totalObjects :: Maybe Integer
$sel:totalObjects:DataTransfer' :: DataTransfer -> Maybe Integer
totalObjects} -> Maybe Integer
totalObjects) (\s :: DataTransfer
s@DataTransfer' {} Maybe Integer
a -> DataTransfer
s {$sel:totalObjects:DataTransfer' :: Maybe Integer
totalObjects = Maybe Integer
a} :: DataTransfer)
dataTransfer_totalBytes :: Lens.Lens' DataTransfer (Prelude.Maybe Prelude.Integer)
dataTransfer_totalBytes :: (Maybe Integer -> f (Maybe Integer))
-> DataTransfer -> f DataTransfer
dataTransfer_totalBytes = (DataTransfer -> Maybe Integer)
-> (DataTransfer -> Maybe Integer -> DataTransfer)
-> Lens DataTransfer DataTransfer (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataTransfer' {Maybe Integer
totalBytes :: Maybe Integer
$sel:totalBytes:DataTransfer' :: DataTransfer -> Maybe Integer
totalBytes} -> Maybe Integer
totalBytes) (\s :: DataTransfer
s@DataTransfer' {} Maybe Integer
a -> DataTransfer
s {$sel:totalBytes:DataTransfer' :: Maybe Integer
totalBytes = Maybe Integer
a} :: DataTransfer)
dataTransfer_objectsTransferred :: Lens.Lens' DataTransfer (Prelude.Maybe Prelude.Integer)
dataTransfer_objectsTransferred :: (Maybe Integer -> f (Maybe Integer))
-> DataTransfer -> f DataTransfer
dataTransfer_objectsTransferred = (DataTransfer -> Maybe Integer)
-> (DataTransfer -> Maybe Integer -> DataTransfer)
-> Lens DataTransfer DataTransfer (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataTransfer' {Maybe Integer
objectsTransferred :: Maybe Integer
$sel:objectsTransferred:DataTransfer' :: DataTransfer -> Maybe Integer
objectsTransferred} -> Maybe Integer
objectsTransferred) (\s :: DataTransfer
s@DataTransfer' {} Maybe Integer
a -> DataTransfer
s {$sel:objectsTransferred:DataTransfer' :: Maybe Integer
objectsTransferred = Maybe Integer
a} :: DataTransfer)
dataTransfer_bytesTransferred :: Lens.Lens' DataTransfer (Prelude.Maybe Prelude.Integer)
dataTransfer_bytesTransferred :: (Maybe Integer -> f (Maybe Integer))
-> DataTransfer -> f DataTransfer
dataTransfer_bytesTransferred = (DataTransfer -> Maybe Integer)
-> (DataTransfer -> Maybe Integer -> DataTransfer)
-> Lens DataTransfer DataTransfer (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataTransfer' {Maybe Integer
bytesTransferred :: Maybe Integer
$sel:bytesTransferred:DataTransfer' :: DataTransfer -> Maybe Integer
bytesTransferred} -> Maybe Integer
bytesTransferred) (\s :: DataTransfer
s@DataTransfer' {} Maybe Integer
a -> DataTransfer
s {$sel:bytesTransferred:DataTransfer' :: Maybe Integer
bytesTransferred = Maybe Integer
a} :: DataTransfer)
instance Core.FromJSON DataTransfer where
parseJSON :: Value -> Parser DataTransfer
parseJSON =
String
-> (Object -> Parser DataTransfer) -> Value -> Parser DataTransfer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DataTransfer"
( \Object
x ->
Maybe Integer
-> Maybe Integer -> Maybe Integer -> Maybe Integer -> DataTransfer
DataTransfer'
(Maybe Integer
-> Maybe Integer -> Maybe Integer -> Maybe Integer -> DataTransfer)
-> Parser (Maybe Integer)
-> Parser
(Maybe Integer -> Maybe Integer -> Maybe Integer -> DataTransfer)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalObjects")
Parser
(Maybe Integer -> Maybe Integer -> Maybe Integer -> DataTransfer)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> Maybe Integer -> DataTransfer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalBytes")
Parser (Maybe Integer -> Maybe Integer -> DataTransfer)
-> Parser (Maybe Integer) -> Parser (Maybe Integer -> DataTransfer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ObjectsTransferred")
Parser (Maybe Integer -> DataTransfer)
-> Parser (Maybe Integer) -> Parser DataTransfer
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BytesTransferred")
)
instance Prelude.Hashable DataTransfer
instance Prelude.NFData DataTransfer