{-# 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.WorkMail.Types.MailboxExportJob where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkMail.Types.MailboxExportJobState
data MailboxExportJob = MailboxExportJob'
{
MailboxExportJob -> Maybe MailboxExportJobState
state :: Prelude.Maybe MailboxExportJobState,
MailboxExportJob -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
MailboxExportJob -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
MailboxExportJob -> Maybe Natural
estimatedProgress :: Prelude.Maybe Prelude.Natural,
MailboxExportJob -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
MailboxExportJob -> Maybe Text
s3Path :: Prelude.Maybe Prelude.Text,
MailboxExportJob -> Maybe Text
entityId :: Prelude.Maybe Prelude.Text,
MailboxExportJob -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
MailboxExportJob -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text
}
deriving (MailboxExportJob -> MailboxExportJob -> Bool
(MailboxExportJob -> MailboxExportJob -> Bool)
-> (MailboxExportJob -> MailboxExportJob -> Bool)
-> Eq MailboxExportJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MailboxExportJob -> MailboxExportJob -> Bool
$c/= :: MailboxExportJob -> MailboxExportJob -> Bool
== :: MailboxExportJob -> MailboxExportJob -> Bool
$c== :: MailboxExportJob -> MailboxExportJob -> Bool
Prelude.Eq, ReadPrec [MailboxExportJob]
ReadPrec MailboxExportJob
Int -> ReadS MailboxExportJob
ReadS [MailboxExportJob]
(Int -> ReadS MailboxExportJob)
-> ReadS [MailboxExportJob]
-> ReadPrec MailboxExportJob
-> ReadPrec [MailboxExportJob]
-> Read MailboxExportJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MailboxExportJob]
$creadListPrec :: ReadPrec [MailboxExportJob]
readPrec :: ReadPrec MailboxExportJob
$creadPrec :: ReadPrec MailboxExportJob
readList :: ReadS [MailboxExportJob]
$creadList :: ReadS [MailboxExportJob]
readsPrec :: Int -> ReadS MailboxExportJob
$creadsPrec :: Int -> ReadS MailboxExportJob
Prelude.Read, Int -> MailboxExportJob -> ShowS
[MailboxExportJob] -> ShowS
MailboxExportJob -> String
(Int -> MailboxExportJob -> ShowS)
-> (MailboxExportJob -> String)
-> ([MailboxExportJob] -> ShowS)
-> Show MailboxExportJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MailboxExportJob] -> ShowS
$cshowList :: [MailboxExportJob] -> ShowS
show :: MailboxExportJob -> String
$cshow :: MailboxExportJob -> String
showsPrec :: Int -> MailboxExportJob -> ShowS
$cshowsPrec :: Int -> MailboxExportJob -> ShowS
Prelude.Show, (forall x. MailboxExportJob -> Rep MailboxExportJob x)
-> (forall x. Rep MailboxExportJob x -> MailboxExportJob)
-> Generic MailboxExportJob
forall x. Rep MailboxExportJob x -> MailboxExportJob
forall x. MailboxExportJob -> Rep MailboxExportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MailboxExportJob x -> MailboxExportJob
$cfrom :: forall x. MailboxExportJob -> Rep MailboxExportJob x
Prelude.Generic)
newMailboxExportJob ::
MailboxExportJob
newMailboxExportJob :: MailboxExportJob
newMailboxExportJob =
MailboxExportJob' :: Maybe MailboxExportJobState
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob
MailboxExportJob'
{ $sel:state:MailboxExportJob' :: Maybe MailboxExportJobState
state = Maybe MailboxExportJobState
forall a. Maybe a
Prelude.Nothing,
$sel:jobId:MailboxExportJob' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:startTime:MailboxExportJob' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:estimatedProgress:MailboxExportJob' :: Maybe Natural
estimatedProgress = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:MailboxExportJob' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:s3Path:MailboxExportJob' :: Maybe Text
s3Path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entityId:MailboxExportJob' :: Maybe Text
entityId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:MailboxExportJob' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3BucketName:MailboxExportJob' :: Maybe Text
s3BucketName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
mailboxExportJob_state :: Lens.Lens' MailboxExportJob (Prelude.Maybe MailboxExportJobState)
mailboxExportJob_state :: (Maybe MailboxExportJobState -> f (Maybe MailboxExportJobState))
-> MailboxExportJob -> f MailboxExportJob
mailboxExportJob_state = (MailboxExportJob -> Maybe MailboxExportJobState)
-> (MailboxExportJob
-> Maybe MailboxExportJobState -> MailboxExportJob)
-> Lens
MailboxExportJob
MailboxExportJob
(Maybe MailboxExportJobState)
(Maybe MailboxExportJobState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MailboxExportJob' {Maybe MailboxExportJobState
state :: Maybe MailboxExportJobState
$sel:state:MailboxExportJob' :: MailboxExportJob -> Maybe MailboxExportJobState
state} -> Maybe MailboxExportJobState
state) (\s :: MailboxExportJob
s@MailboxExportJob' {} Maybe MailboxExportJobState
a -> MailboxExportJob
s {$sel:state:MailboxExportJob' :: Maybe MailboxExportJobState
state = Maybe MailboxExportJobState
a} :: MailboxExportJob)
mailboxExportJob_jobId :: Lens.Lens' MailboxExportJob (Prelude.Maybe Prelude.Text)
mailboxExportJob_jobId :: (Maybe Text -> f (Maybe Text))
-> MailboxExportJob -> f MailboxExportJob
mailboxExportJob_jobId = (MailboxExportJob -> Maybe Text)
-> (MailboxExportJob -> Maybe Text -> MailboxExportJob)
-> Lens MailboxExportJob MailboxExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MailboxExportJob' {Maybe Text
jobId :: Maybe Text
$sel:jobId:MailboxExportJob' :: MailboxExportJob -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: MailboxExportJob
s@MailboxExportJob' {} Maybe Text
a -> MailboxExportJob
s {$sel:jobId:MailboxExportJob' :: Maybe Text
jobId = Maybe Text
a} :: MailboxExportJob)
mailboxExportJob_startTime :: Lens.Lens' MailboxExportJob (Prelude.Maybe Prelude.UTCTime)
mailboxExportJob_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MailboxExportJob -> f MailboxExportJob
mailboxExportJob_startTime = (MailboxExportJob -> Maybe POSIX)
-> (MailboxExportJob -> Maybe POSIX -> MailboxExportJob)
-> Lens
MailboxExportJob MailboxExportJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MailboxExportJob' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:MailboxExportJob' :: MailboxExportJob -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: MailboxExportJob
s@MailboxExportJob' {} Maybe POSIX
a -> MailboxExportJob
s {$sel:startTime:MailboxExportJob' :: Maybe POSIX
startTime = Maybe POSIX
a} :: MailboxExportJob) ((Maybe POSIX -> f (Maybe POSIX))
-> MailboxExportJob -> f MailboxExportJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MailboxExportJob
-> f MailboxExportJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
mailboxExportJob_estimatedProgress :: Lens.Lens' MailboxExportJob (Prelude.Maybe Prelude.Natural)
mailboxExportJob_estimatedProgress :: (Maybe Natural -> f (Maybe Natural))
-> MailboxExportJob -> f MailboxExportJob
mailboxExportJob_estimatedProgress = (MailboxExportJob -> Maybe Natural)
-> (MailboxExportJob -> Maybe Natural -> MailboxExportJob)
-> Lens
MailboxExportJob MailboxExportJob (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MailboxExportJob' {Maybe Natural
estimatedProgress :: Maybe Natural
$sel:estimatedProgress:MailboxExportJob' :: MailboxExportJob -> Maybe Natural
estimatedProgress} -> Maybe Natural
estimatedProgress) (\s :: MailboxExportJob
s@MailboxExportJob' {} Maybe Natural
a -> MailboxExportJob
s {$sel:estimatedProgress:MailboxExportJob' :: Maybe Natural
estimatedProgress = Maybe Natural
a} :: MailboxExportJob)
mailboxExportJob_endTime :: Lens.Lens' MailboxExportJob (Prelude.Maybe Prelude.UTCTime)
mailboxExportJob_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MailboxExportJob -> f MailboxExportJob
mailboxExportJob_endTime = (MailboxExportJob -> Maybe POSIX)
-> (MailboxExportJob -> Maybe POSIX -> MailboxExportJob)
-> Lens
MailboxExportJob MailboxExportJob (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MailboxExportJob' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:MailboxExportJob' :: MailboxExportJob -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: MailboxExportJob
s@MailboxExportJob' {} Maybe POSIX
a -> MailboxExportJob
s {$sel:endTime:MailboxExportJob' :: Maybe POSIX
endTime = Maybe POSIX
a} :: MailboxExportJob) ((Maybe POSIX -> f (Maybe POSIX))
-> MailboxExportJob -> f MailboxExportJob)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MailboxExportJob
-> f MailboxExportJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
mailboxExportJob_s3Path :: Lens.Lens' MailboxExportJob (Prelude.Maybe Prelude.Text)
mailboxExportJob_s3Path :: (Maybe Text -> f (Maybe Text))
-> MailboxExportJob -> f MailboxExportJob
mailboxExportJob_s3Path = (MailboxExportJob -> Maybe Text)
-> (MailboxExportJob -> Maybe Text -> MailboxExportJob)
-> Lens MailboxExportJob MailboxExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MailboxExportJob' {Maybe Text
s3Path :: Maybe Text
$sel:s3Path:MailboxExportJob' :: MailboxExportJob -> Maybe Text
s3Path} -> Maybe Text
s3Path) (\s :: MailboxExportJob
s@MailboxExportJob' {} Maybe Text
a -> MailboxExportJob
s {$sel:s3Path:MailboxExportJob' :: Maybe Text
s3Path = Maybe Text
a} :: MailboxExportJob)
mailboxExportJob_entityId :: Lens.Lens' MailboxExportJob (Prelude.Maybe Prelude.Text)
mailboxExportJob_entityId :: (Maybe Text -> f (Maybe Text))
-> MailboxExportJob -> f MailboxExportJob
mailboxExportJob_entityId = (MailboxExportJob -> Maybe Text)
-> (MailboxExportJob -> Maybe Text -> MailboxExportJob)
-> Lens MailboxExportJob MailboxExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MailboxExportJob' {Maybe Text
entityId :: Maybe Text
$sel:entityId:MailboxExportJob' :: MailboxExportJob -> Maybe Text
entityId} -> Maybe Text
entityId) (\s :: MailboxExportJob
s@MailboxExportJob' {} Maybe Text
a -> MailboxExportJob
s {$sel:entityId:MailboxExportJob' :: Maybe Text
entityId = Maybe Text
a} :: MailboxExportJob)
mailboxExportJob_description :: Lens.Lens' MailboxExportJob (Prelude.Maybe Prelude.Text)
mailboxExportJob_description :: (Maybe Text -> f (Maybe Text))
-> MailboxExportJob -> f MailboxExportJob
mailboxExportJob_description = (MailboxExportJob -> Maybe Text)
-> (MailboxExportJob -> Maybe Text -> MailboxExportJob)
-> Lens MailboxExportJob MailboxExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MailboxExportJob' {Maybe Text
description :: Maybe Text
$sel:description:MailboxExportJob' :: MailboxExportJob -> Maybe Text
description} -> Maybe Text
description) (\s :: MailboxExportJob
s@MailboxExportJob' {} Maybe Text
a -> MailboxExportJob
s {$sel:description:MailboxExportJob' :: Maybe Text
description = Maybe Text
a} :: MailboxExportJob)
mailboxExportJob_s3BucketName :: Lens.Lens' MailboxExportJob (Prelude.Maybe Prelude.Text)
mailboxExportJob_s3BucketName :: (Maybe Text -> f (Maybe Text))
-> MailboxExportJob -> f MailboxExportJob
mailboxExportJob_s3BucketName = (MailboxExportJob -> Maybe Text)
-> (MailboxExportJob -> Maybe Text -> MailboxExportJob)
-> Lens MailboxExportJob MailboxExportJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MailboxExportJob' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:MailboxExportJob' :: MailboxExportJob -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: MailboxExportJob
s@MailboxExportJob' {} Maybe Text
a -> MailboxExportJob
s {$sel:s3BucketName:MailboxExportJob' :: Maybe Text
s3BucketName = Maybe Text
a} :: MailboxExportJob)
instance Core.FromJSON MailboxExportJob where
parseJSON :: Value -> Parser MailboxExportJob
parseJSON =
String
-> (Object -> Parser MailboxExportJob)
-> Value
-> Parser MailboxExportJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MailboxExportJob"
( \Object
x ->
Maybe MailboxExportJobState
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob
MailboxExportJob'
(Maybe MailboxExportJobState
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob)
-> Parser (Maybe MailboxExportJobState)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MailboxExportJobState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob)
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
"JobId")
Parser
(Maybe POSIX
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StartTime")
Parser
(Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob)
-> Parser (Maybe Natural)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EstimatedProgress")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MailboxExportJob)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> MailboxExportJob)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndTime")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> MailboxExportJob)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> MailboxExportJob)
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
"S3Path")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> MailboxExportJob)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> MailboxExportJob)
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
"EntityId")
Parser (Maybe Text -> Maybe Text -> MailboxExportJob)
-> Parser (Maybe Text) -> Parser (Maybe Text -> MailboxExportJob)
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
"Description")
Parser (Maybe Text -> MailboxExportJob)
-> Parser (Maybe Text) -> Parser MailboxExportJob
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
"S3BucketName")
)
instance Prelude.Hashable MailboxExportJob
instance Prelude.NFData MailboxExportJob