{-# 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.Personalize.DescribeDatasetExportJob
(
DescribeDatasetExportJob (..),
newDescribeDatasetExportJob,
describeDatasetExportJob_datasetExportJobArn,
DescribeDatasetExportJobResponse (..),
newDescribeDatasetExportJobResponse,
describeDatasetExportJobResponse_datasetExportJob,
describeDatasetExportJobResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Personalize.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeDatasetExportJob = DescribeDatasetExportJob'
{
DescribeDatasetExportJob -> Text
datasetExportJobArn :: Prelude.Text
}
deriving (DescribeDatasetExportJob -> DescribeDatasetExportJob -> Bool
(DescribeDatasetExportJob -> DescribeDatasetExportJob -> Bool)
-> (DescribeDatasetExportJob -> DescribeDatasetExportJob -> Bool)
-> Eq DescribeDatasetExportJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDatasetExportJob -> DescribeDatasetExportJob -> Bool
$c/= :: DescribeDatasetExportJob -> DescribeDatasetExportJob -> Bool
== :: DescribeDatasetExportJob -> DescribeDatasetExportJob -> Bool
$c== :: DescribeDatasetExportJob -> DescribeDatasetExportJob -> Bool
Prelude.Eq, ReadPrec [DescribeDatasetExportJob]
ReadPrec DescribeDatasetExportJob
Int -> ReadS DescribeDatasetExportJob
ReadS [DescribeDatasetExportJob]
(Int -> ReadS DescribeDatasetExportJob)
-> ReadS [DescribeDatasetExportJob]
-> ReadPrec DescribeDatasetExportJob
-> ReadPrec [DescribeDatasetExportJob]
-> Read DescribeDatasetExportJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDatasetExportJob]
$creadListPrec :: ReadPrec [DescribeDatasetExportJob]
readPrec :: ReadPrec DescribeDatasetExportJob
$creadPrec :: ReadPrec DescribeDatasetExportJob
readList :: ReadS [DescribeDatasetExportJob]
$creadList :: ReadS [DescribeDatasetExportJob]
readsPrec :: Int -> ReadS DescribeDatasetExportJob
$creadsPrec :: Int -> ReadS DescribeDatasetExportJob
Prelude.Read, Int -> DescribeDatasetExportJob -> ShowS
[DescribeDatasetExportJob] -> ShowS
DescribeDatasetExportJob -> String
(Int -> DescribeDatasetExportJob -> ShowS)
-> (DescribeDatasetExportJob -> String)
-> ([DescribeDatasetExportJob] -> ShowS)
-> Show DescribeDatasetExportJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDatasetExportJob] -> ShowS
$cshowList :: [DescribeDatasetExportJob] -> ShowS
show :: DescribeDatasetExportJob -> String
$cshow :: DescribeDatasetExportJob -> String
showsPrec :: Int -> DescribeDatasetExportJob -> ShowS
$cshowsPrec :: Int -> DescribeDatasetExportJob -> ShowS
Prelude.Show, (forall x.
DescribeDatasetExportJob -> Rep DescribeDatasetExportJob x)
-> (forall x.
Rep DescribeDatasetExportJob x -> DescribeDatasetExportJob)
-> Generic DescribeDatasetExportJob
forall x.
Rep DescribeDatasetExportJob x -> DescribeDatasetExportJob
forall x.
DescribeDatasetExportJob -> Rep DescribeDatasetExportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDatasetExportJob x -> DescribeDatasetExportJob
$cfrom :: forall x.
DescribeDatasetExportJob -> Rep DescribeDatasetExportJob x
Prelude.Generic)
newDescribeDatasetExportJob ::
Prelude.Text ->
DescribeDatasetExportJob
newDescribeDatasetExportJob :: Text -> DescribeDatasetExportJob
newDescribeDatasetExportJob Text
pDatasetExportJobArn_ =
DescribeDatasetExportJob' :: Text -> DescribeDatasetExportJob
DescribeDatasetExportJob'
{ $sel:datasetExportJobArn:DescribeDatasetExportJob' :: Text
datasetExportJobArn =
Text
pDatasetExportJobArn_
}
describeDatasetExportJob_datasetExportJobArn :: Lens.Lens' DescribeDatasetExportJob Prelude.Text
describeDatasetExportJob_datasetExportJobArn :: (Text -> f Text)
-> DescribeDatasetExportJob -> f DescribeDatasetExportJob
describeDatasetExportJob_datasetExportJobArn = (DescribeDatasetExportJob -> Text)
-> (DescribeDatasetExportJob -> Text -> DescribeDatasetExportJob)
-> Lens DescribeDatasetExportJob DescribeDatasetExportJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetExportJob' {Text
datasetExportJobArn :: Text
$sel:datasetExportJobArn:DescribeDatasetExportJob' :: DescribeDatasetExportJob -> Text
datasetExportJobArn} -> Text
datasetExportJobArn) (\s :: DescribeDatasetExportJob
s@DescribeDatasetExportJob' {} Text
a -> DescribeDatasetExportJob
s {$sel:datasetExportJobArn:DescribeDatasetExportJob' :: Text
datasetExportJobArn = Text
a} :: DescribeDatasetExportJob)
instance Core.AWSRequest DescribeDatasetExportJob where
type
AWSResponse DescribeDatasetExportJob =
DescribeDatasetExportJobResponse
request :: DescribeDatasetExportJob -> Request DescribeDatasetExportJob
request = Service
-> DescribeDatasetExportJob -> Request DescribeDatasetExportJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeDatasetExportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDatasetExportJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeDatasetExportJob))
-> Logger
-> Service
-> Proxy DescribeDatasetExportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDatasetExportJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe DatasetExportJob -> Int -> DescribeDatasetExportJobResponse
DescribeDatasetExportJobResponse'
(Maybe DatasetExportJob -> Int -> DescribeDatasetExportJobResponse)
-> Either String (Maybe DatasetExportJob)
-> Either String (Int -> DescribeDatasetExportJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DatasetExportJob)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"datasetExportJob")
Either String (Int -> DescribeDatasetExportJobResponse)
-> Either String Int
-> Either String DescribeDatasetExportJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeDatasetExportJob
instance Prelude.NFData DescribeDatasetExportJob
instance Core.ToHeaders DescribeDatasetExportJob where
toHeaders :: DescribeDatasetExportJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeDatasetExportJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonPersonalize.DescribeDatasetExportJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeDatasetExportJob where
toJSON :: DescribeDatasetExportJob -> Value
toJSON DescribeDatasetExportJob' {Text
datasetExportJobArn :: Text
$sel:datasetExportJobArn:DescribeDatasetExportJob' :: DescribeDatasetExportJob -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"datasetExportJobArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetExportJobArn)
]
)
instance Core.ToPath DescribeDatasetExportJob where
toPath :: DescribeDatasetExportJob -> ByteString
toPath = ByteString -> DescribeDatasetExportJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeDatasetExportJob where
toQuery :: DescribeDatasetExportJob -> QueryString
toQuery = QueryString -> DescribeDatasetExportJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeDatasetExportJobResponse = DescribeDatasetExportJobResponse'
{
DescribeDatasetExportJobResponse -> Maybe DatasetExportJob
datasetExportJob :: Prelude.Maybe DatasetExportJob,
DescribeDatasetExportJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeDatasetExportJobResponse
-> DescribeDatasetExportJobResponse -> Bool
(DescribeDatasetExportJobResponse
-> DescribeDatasetExportJobResponse -> Bool)
-> (DescribeDatasetExportJobResponse
-> DescribeDatasetExportJobResponse -> Bool)
-> Eq DescribeDatasetExportJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDatasetExportJobResponse
-> DescribeDatasetExportJobResponse -> Bool
$c/= :: DescribeDatasetExportJobResponse
-> DescribeDatasetExportJobResponse -> Bool
== :: DescribeDatasetExportJobResponse
-> DescribeDatasetExportJobResponse -> Bool
$c== :: DescribeDatasetExportJobResponse
-> DescribeDatasetExportJobResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDatasetExportJobResponse]
ReadPrec DescribeDatasetExportJobResponse
Int -> ReadS DescribeDatasetExportJobResponse
ReadS [DescribeDatasetExportJobResponse]
(Int -> ReadS DescribeDatasetExportJobResponse)
-> ReadS [DescribeDatasetExportJobResponse]
-> ReadPrec DescribeDatasetExportJobResponse
-> ReadPrec [DescribeDatasetExportJobResponse]
-> Read DescribeDatasetExportJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDatasetExportJobResponse]
$creadListPrec :: ReadPrec [DescribeDatasetExportJobResponse]
readPrec :: ReadPrec DescribeDatasetExportJobResponse
$creadPrec :: ReadPrec DescribeDatasetExportJobResponse
readList :: ReadS [DescribeDatasetExportJobResponse]
$creadList :: ReadS [DescribeDatasetExportJobResponse]
readsPrec :: Int -> ReadS DescribeDatasetExportJobResponse
$creadsPrec :: Int -> ReadS DescribeDatasetExportJobResponse
Prelude.Read, Int -> DescribeDatasetExportJobResponse -> ShowS
[DescribeDatasetExportJobResponse] -> ShowS
DescribeDatasetExportJobResponse -> String
(Int -> DescribeDatasetExportJobResponse -> ShowS)
-> (DescribeDatasetExportJobResponse -> String)
-> ([DescribeDatasetExportJobResponse] -> ShowS)
-> Show DescribeDatasetExportJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDatasetExportJobResponse] -> ShowS
$cshowList :: [DescribeDatasetExportJobResponse] -> ShowS
show :: DescribeDatasetExportJobResponse -> String
$cshow :: DescribeDatasetExportJobResponse -> String
showsPrec :: Int -> DescribeDatasetExportJobResponse -> ShowS
$cshowsPrec :: Int -> DescribeDatasetExportJobResponse -> ShowS
Prelude.Show, (forall x.
DescribeDatasetExportJobResponse
-> Rep DescribeDatasetExportJobResponse x)
-> (forall x.
Rep DescribeDatasetExportJobResponse x
-> DescribeDatasetExportJobResponse)
-> Generic DescribeDatasetExportJobResponse
forall x.
Rep DescribeDatasetExportJobResponse x
-> DescribeDatasetExportJobResponse
forall x.
DescribeDatasetExportJobResponse
-> Rep DescribeDatasetExportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDatasetExportJobResponse x
-> DescribeDatasetExportJobResponse
$cfrom :: forall x.
DescribeDatasetExportJobResponse
-> Rep DescribeDatasetExportJobResponse x
Prelude.Generic)
newDescribeDatasetExportJobResponse ::
Prelude.Int ->
DescribeDatasetExportJobResponse
newDescribeDatasetExportJobResponse :: Int -> DescribeDatasetExportJobResponse
newDescribeDatasetExportJobResponse Int
pHttpStatus_ =
DescribeDatasetExportJobResponse' :: Maybe DatasetExportJob -> Int -> DescribeDatasetExportJobResponse
DescribeDatasetExportJobResponse'
{ $sel:datasetExportJob:DescribeDatasetExportJobResponse' :: Maybe DatasetExportJob
datasetExportJob =
Maybe DatasetExportJob
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeDatasetExportJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeDatasetExportJobResponse_datasetExportJob :: Lens.Lens' DescribeDatasetExportJobResponse (Prelude.Maybe DatasetExportJob)
describeDatasetExportJobResponse_datasetExportJob :: (Maybe DatasetExportJob -> f (Maybe DatasetExportJob))
-> DescribeDatasetExportJobResponse
-> f DescribeDatasetExportJobResponse
describeDatasetExportJobResponse_datasetExportJob = (DescribeDatasetExportJobResponse -> Maybe DatasetExportJob)
-> (DescribeDatasetExportJobResponse
-> Maybe DatasetExportJob -> DescribeDatasetExportJobResponse)
-> Lens
DescribeDatasetExportJobResponse
DescribeDatasetExportJobResponse
(Maybe DatasetExportJob)
(Maybe DatasetExportJob)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetExportJobResponse' {Maybe DatasetExportJob
datasetExportJob :: Maybe DatasetExportJob
$sel:datasetExportJob:DescribeDatasetExportJobResponse' :: DescribeDatasetExportJobResponse -> Maybe DatasetExportJob
datasetExportJob} -> Maybe DatasetExportJob
datasetExportJob) (\s :: DescribeDatasetExportJobResponse
s@DescribeDatasetExportJobResponse' {} Maybe DatasetExportJob
a -> DescribeDatasetExportJobResponse
s {$sel:datasetExportJob:DescribeDatasetExportJobResponse' :: Maybe DatasetExportJob
datasetExportJob = Maybe DatasetExportJob
a} :: DescribeDatasetExportJobResponse)
describeDatasetExportJobResponse_httpStatus :: Lens.Lens' DescribeDatasetExportJobResponse Prelude.Int
describeDatasetExportJobResponse_httpStatus :: (Int -> f Int)
-> DescribeDatasetExportJobResponse
-> f DescribeDatasetExportJobResponse
describeDatasetExportJobResponse_httpStatus = (DescribeDatasetExportJobResponse -> Int)
-> (DescribeDatasetExportJobResponse
-> Int -> DescribeDatasetExportJobResponse)
-> Lens
DescribeDatasetExportJobResponse
DescribeDatasetExportJobResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetExportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeDatasetExportJobResponse' :: DescribeDatasetExportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeDatasetExportJobResponse
s@DescribeDatasetExportJobResponse' {} Int
a -> DescribeDatasetExportJobResponse
s {$sel:httpStatus:DescribeDatasetExportJobResponse' :: Int
httpStatus = Int
a} :: DescribeDatasetExportJobResponse)
instance
Prelude.NFData
DescribeDatasetExportJobResponse