{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.WorkMail.ListMailboxExportJobs
(
ListMailboxExportJobs (..),
newListMailboxExportJobs,
listMailboxExportJobs_maxResults,
listMailboxExportJobs_nextToken,
listMailboxExportJobs_organizationId,
ListMailboxExportJobsResponse (..),
newListMailboxExportJobsResponse,
listMailboxExportJobsResponse_jobs,
listMailboxExportJobsResponse_nextToken,
listMailboxExportJobsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkMail.Types
data ListMailboxExportJobs = ListMailboxExportJobs'
{
ListMailboxExportJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListMailboxExportJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListMailboxExportJobs -> Text
organizationId :: Prelude.Text
}
deriving (ListMailboxExportJobs -> ListMailboxExportJobs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMailboxExportJobs -> ListMailboxExportJobs -> Bool
$c/= :: ListMailboxExportJobs -> ListMailboxExportJobs -> Bool
== :: ListMailboxExportJobs -> ListMailboxExportJobs -> Bool
$c== :: ListMailboxExportJobs -> ListMailboxExportJobs -> Bool
Prelude.Eq, ReadPrec [ListMailboxExportJobs]
ReadPrec ListMailboxExportJobs
Int -> ReadS ListMailboxExportJobs
ReadS [ListMailboxExportJobs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMailboxExportJobs]
$creadListPrec :: ReadPrec [ListMailboxExportJobs]
readPrec :: ReadPrec ListMailboxExportJobs
$creadPrec :: ReadPrec ListMailboxExportJobs
readList :: ReadS [ListMailboxExportJobs]
$creadList :: ReadS [ListMailboxExportJobs]
readsPrec :: Int -> ReadS ListMailboxExportJobs
$creadsPrec :: Int -> ReadS ListMailboxExportJobs
Prelude.Read, Int -> ListMailboxExportJobs -> ShowS
[ListMailboxExportJobs] -> ShowS
ListMailboxExportJobs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMailboxExportJobs] -> ShowS
$cshowList :: [ListMailboxExportJobs] -> ShowS
show :: ListMailboxExportJobs -> String
$cshow :: ListMailboxExportJobs -> String
showsPrec :: Int -> ListMailboxExportJobs -> ShowS
$cshowsPrec :: Int -> ListMailboxExportJobs -> ShowS
Prelude.Show, forall x. Rep ListMailboxExportJobs x -> ListMailboxExportJobs
forall x. ListMailboxExportJobs -> Rep ListMailboxExportJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMailboxExportJobs x -> ListMailboxExportJobs
$cfrom :: forall x. ListMailboxExportJobs -> Rep ListMailboxExportJobs x
Prelude.Generic)
newListMailboxExportJobs ::
Prelude.Text ->
ListMailboxExportJobs
newListMailboxExportJobs :: Text -> ListMailboxExportJobs
newListMailboxExportJobs Text
pOrganizationId_ =
ListMailboxExportJobs'
{ $sel:maxResults:ListMailboxExportJobs' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListMailboxExportJobs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:organizationId:ListMailboxExportJobs' :: Text
organizationId = Text
pOrganizationId_
}
listMailboxExportJobs_maxResults :: Lens.Lens' ListMailboxExportJobs (Prelude.Maybe Prelude.Natural)
listMailboxExportJobs_maxResults :: Lens' ListMailboxExportJobs (Maybe Natural)
listMailboxExportJobs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMailboxExportJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListMailboxExportJobs' :: ListMailboxExportJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListMailboxExportJobs
s@ListMailboxExportJobs' {} Maybe Natural
a -> ListMailboxExportJobs
s {$sel:maxResults:ListMailboxExportJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListMailboxExportJobs)
listMailboxExportJobs_nextToken :: Lens.Lens' ListMailboxExportJobs (Prelude.Maybe Prelude.Text)
listMailboxExportJobs_nextToken :: Lens' ListMailboxExportJobs (Maybe Text)
listMailboxExportJobs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMailboxExportJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMailboxExportJobs' :: ListMailboxExportJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMailboxExportJobs
s@ListMailboxExportJobs' {} Maybe Text
a -> ListMailboxExportJobs
s {$sel:nextToken:ListMailboxExportJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListMailboxExportJobs)
listMailboxExportJobs_organizationId :: Lens.Lens' ListMailboxExportJobs Prelude.Text
listMailboxExportJobs_organizationId :: Lens' ListMailboxExportJobs Text
listMailboxExportJobs_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMailboxExportJobs' {Text
organizationId :: Text
$sel:organizationId:ListMailboxExportJobs' :: ListMailboxExportJobs -> Text
organizationId} -> Text
organizationId) (\s :: ListMailboxExportJobs
s@ListMailboxExportJobs' {} Text
a -> ListMailboxExportJobs
s {$sel:organizationId:ListMailboxExportJobs' :: Text
organizationId = Text
a} :: ListMailboxExportJobs)
instance Core.AWSRequest ListMailboxExportJobs where
type
AWSResponse ListMailboxExportJobs =
ListMailboxExportJobsResponse
request :: (Service -> Service)
-> ListMailboxExportJobs -> Request ListMailboxExportJobs
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListMailboxExportJobs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListMailboxExportJobs)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [MailboxExportJob]
-> Maybe Text -> Int -> ListMailboxExportJobsResponse
ListMailboxExportJobsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Jobs" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListMailboxExportJobs where
hashWithSalt :: Int -> ListMailboxExportJobs -> Int
hashWithSalt Int
_salt ListMailboxExportJobs' {Maybe Natural
Maybe Text
Text
organizationId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:organizationId:ListMailboxExportJobs' :: ListMailboxExportJobs -> Text
$sel:nextToken:ListMailboxExportJobs' :: ListMailboxExportJobs -> Maybe Text
$sel:maxResults:ListMailboxExportJobs' :: ListMailboxExportJobs -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
instance Prelude.NFData ListMailboxExportJobs where
rnf :: ListMailboxExportJobs -> ()
rnf ListMailboxExportJobs' {Maybe Natural
Maybe Text
Text
organizationId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:organizationId:ListMailboxExportJobs' :: ListMailboxExportJobs -> Text
$sel:nextToken:ListMailboxExportJobs' :: ListMailboxExportJobs -> Maybe Text
$sel:maxResults:ListMailboxExportJobs' :: ListMailboxExportJobs -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId
instance Data.ToHeaders ListMailboxExportJobs where
toHeaders :: ListMailboxExportJobs -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"WorkMailService.ListMailboxExportJobs" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListMailboxExportJobs where
toJSON :: ListMailboxExportJobs -> Value
toJSON ListMailboxExportJobs' {Maybe Natural
Maybe Text
Text
organizationId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:organizationId:ListMailboxExportJobs' :: ListMailboxExportJobs -> Text
$sel:nextToken:ListMailboxExportJobs' :: ListMailboxExportJobs -> Maybe Text
$sel:maxResults:ListMailboxExportJobs' :: ListMailboxExportJobs -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
forall a. a -> Maybe a
Prelude.Just
(Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId)
]
)
instance Data.ToPath ListMailboxExportJobs where
toPath :: ListMailboxExportJobs -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListMailboxExportJobs where
toQuery :: ListMailboxExportJobs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListMailboxExportJobsResponse = ListMailboxExportJobsResponse'
{
ListMailboxExportJobsResponse -> Maybe [MailboxExportJob]
jobs :: Prelude.Maybe [MailboxExportJob],
ListMailboxExportJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListMailboxExportJobsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListMailboxExportJobsResponse
-> ListMailboxExportJobsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMailboxExportJobsResponse
-> ListMailboxExportJobsResponse -> Bool
$c/= :: ListMailboxExportJobsResponse
-> ListMailboxExportJobsResponse -> Bool
== :: ListMailboxExportJobsResponse
-> ListMailboxExportJobsResponse -> Bool
$c== :: ListMailboxExportJobsResponse
-> ListMailboxExportJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListMailboxExportJobsResponse]
ReadPrec ListMailboxExportJobsResponse
Int -> ReadS ListMailboxExportJobsResponse
ReadS [ListMailboxExportJobsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMailboxExportJobsResponse]
$creadListPrec :: ReadPrec [ListMailboxExportJobsResponse]
readPrec :: ReadPrec ListMailboxExportJobsResponse
$creadPrec :: ReadPrec ListMailboxExportJobsResponse
readList :: ReadS [ListMailboxExportJobsResponse]
$creadList :: ReadS [ListMailboxExportJobsResponse]
readsPrec :: Int -> ReadS ListMailboxExportJobsResponse
$creadsPrec :: Int -> ReadS ListMailboxExportJobsResponse
Prelude.Read, Int -> ListMailboxExportJobsResponse -> ShowS
[ListMailboxExportJobsResponse] -> ShowS
ListMailboxExportJobsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMailboxExportJobsResponse] -> ShowS
$cshowList :: [ListMailboxExportJobsResponse] -> ShowS
show :: ListMailboxExportJobsResponse -> String
$cshow :: ListMailboxExportJobsResponse -> String
showsPrec :: Int -> ListMailboxExportJobsResponse -> ShowS
$cshowsPrec :: Int -> ListMailboxExportJobsResponse -> ShowS
Prelude.Show, forall x.
Rep ListMailboxExportJobsResponse x
-> ListMailboxExportJobsResponse
forall x.
ListMailboxExportJobsResponse
-> Rep ListMailboxExportJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListMailboxExportJobsResponse x
-> ListMailboxExportJobsResponse
$cfrom :: forall x.
ListMailboxExportJobsResponse
-> Rep ListMailboxExportJobsResponse x
Prelude.Generic)
newListMailboxExportJobsResponse ::
Prelude.Int ->
ListMailboxExportJobsResponse
newListMailboxExportJobsResponse :: Int -> ListMailboxExportJobsResponse
newListMailboxExportJobsResponse Int
pHttpStatus_ =
ListMailboxExportJobsResponse'
{ $sel:jobs:ListMailboxExportJobsResponse' :: Maybe [MailboxExportJob]
jobs =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListMailboxExportJobsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListMailboxExportJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listMailboxExportJobsResponse_jobs :: Lens.Lens' ListMailboxExportJobsResponse (Prelude.Maybe [MailboxExportJob])
listMailboxExportJobsResponse_jobs :: Lens' ListMailboxExportJobsResponse (Maybe [MailboxExportJob])
listMailboxExportJobsResponse_jobs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMailboxExportJobsResponse' {Maybe [MailboxExportJob]
jobs :: Maybe [MailboxExportJob]
$sel:jobs:ListMailboxExportJobsResponse' :: ListMailboxExportJobsResponse -> Maybe [MailboxExportJob]
jobs} -> Maybe [MailboxExportJob]
jobs) (\s :: ListMailboxExportJobsResponse
s@ListMailboxExportJobsResponse' {} Maybe [MailboxExportJob]
a -> ListMailboxExportJobsResponse
s {$sel:jobs:ListMailboxExportJobsResponse' :: Maybe [MailboxExportJob]
jobs = Maybe [MailboxExportJob]
a} :: ListMailboxExportJobsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listMailboxExportJobsResponse_nextToken :: Lens.Lens' ListMailboxExportJobsResponse (Prelude.Maybe Prelude.Text)
listMailboxExportJobsResponse_nextToken :: Lens' ListMailboxExportJobsResponse (Maybe Text)
listMailboxExportJobsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMailboxExportJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMailboxExportJobsResponse' :: ListMailboxExportJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMailboxExportJobsResponse
s@ListMailboxExportJobsResponse' {} Maybe Text
a -> ListMailboxExportJobsResponse
s {$sel:nextToken:ListMailboxExportJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListMailboxExportJobsResponse)
listMailboxExportJobsResponse_httpStatus :: Lens.Lens' ListMailboxExportJobsResponse Prelude.Int
listMailboxExportJobsResponse_httpStatus :: Lens' ListMailboxExportJobsResponse Int
listMailboxExportJobsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMailboxExportJobsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListMailboxExportJobsResponse' :: ListMailboxExportJobsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListMailboxExportJobsResponse
s@ListMailboxExportJobsResponse' {} Int
a -> ListMailboxExportJobsResponse
s {$sel:httpStatus:ListMailboxExportJobsResponse' :: Int
httpStatus = Int
a} :: ListMailboxExportJobsResponse)
instance Prelude.NFData ListMailboxExportJobsResponse where
rnf :: ListMailboxExportJobsResponse -> ()
rnf ListMailboxExportJobsResponse' {Int
Maybe [MailboxExportJob]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
jobs :: Maybe [MailboxExportJob]
$sel:httpStatus:ListMailboxExportJobsResponse' :: ListMailboxExportJobsResponse -> Int
$sel:nextToken:ListMailboxExportJobsResponse' :: ListMailboxExportJobsResponse -> Maybe Text
$sel:jobs:ListMailboxExportJobsResponse' :: ListMailboxExportJobsResponse -> Maybe [MailboxExportJob]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [MailboxExportJob]
jobs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus