{-# 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.Comprehend.DescribePiiEntitiesDetectionJob
(
DescribePiiEntitiesDetectionJob (..),
newDescribePiiEntitiesDetectionJob,
describePiiEntitiesDetectionJob_jobId,
DescribePiiEntitiesDetectionJobResponse (..),
newDescribePiiEntitiesDetectionJobResponse,
describePiiEntitiesDetectionJobResponse_piiEntitiesDetectionJobProperties,
describePiiEntitiesDetectionJobResponse_httpStatus,
)
where
import Amazonka.Comprehend.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribePiiEntitiesDetectionJob = DescribePiiEntitiesDetectionJob'
{
DescribePiiEntitiesDetectionJob -> Text
jobId :: Prelude.Text
}
deriving (DescribePiiEntitiesDetectionJob
-> DescribePiiEntitiesDetectionJob -> Bool
(DescribePiiEntitiesDetectionJob
-> DescribePiiEntitiesDetectionJob -> Bool)
-> (DescribePiiEntitiesDetectionJob
-> DescribePiiEntitiesDetectionJob -> Bool)
-> Eq DescribePiiEntitiesDetectionJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePiiEntitiesDetectionJob
-> DescribePiiEntitiesDetectionJob -> Bool
$c/= :: DescribePiiEntitiesDetectionJob
-> DescribePiiEntitiesDetectionJob -> Bool
== :: DescribePiiEntitiesDetectionJob
-> DescribePiiEntitiesDetectionJob -> Bool
$c== :: DescribePiiEntitiesDetectionJob
-> DescribePiiEntitiesDetectionJob -> Bool
Prelude.Eq, ReadPrec [DescribePiiEntitiesDetectionJob]
ReadPrec DescribePiiEntitiesDetectionJob
Int -> ReadS DescribePiiEntitiesDetectionJob
ReadS [DescribePiiEntitiesDetectionJob]
(Int -> ReadS DescribePiiEntitiesDetectionJob)
-> ReadS [DescribePiiEntitiesDetectionJob]
-> ReadPrec DescribePiiEntitiesDetectionJob
-> ReadPrec [DescribePiiEntitiesDetectionJob]
-> Read DescribePiiEntitiesDetectionJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePiiEntitiesDetectionJob]
$creadListPrec :: ReadPrec [DescribePiiEntitiesDetectionJob]
readPrec :: ReadPrec DescribePiiEntitiesDetectionJob
$creadPrec :: ReadPrec DescribePiiEntitiesDetectionJob
readList :: ReadS [DescribePiiEntitiesDetectionJob]
$creadList :: ReadS [DescribePiiEntitiesDetectionJob]
readsPrec :: Int -> ReadS DescribePiiEntitiesDetectionJob
$creadsPrec :: Int -> ReadS DescribePiiEntitiesDetectionJob
Prelude.Read, Int -> DescribePiiEntitiesDetectionJob -> ShowS
[DescribePiiEntitiesDetectionJob] -> ShowS
DescribePiiEntitiesDetectionJob -> String
(Int -> DescribePiiEntitiesDetectionJob -> ShowS)
-> (DescribePiiEntitiesDetectionJob -> String)
-> ([DescribePiiEntitiesDetectionJob] -> ShowS)
-> Show DescribePiiEntitiesDetectionJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePiiEntitiesDetectionJob] -> ShowS
$cshowList :: [DescribePiiEntitiesDetectionJob] -> ShowS
show :: DescribePiiEntitiesDetectionJob -> String
$cshow :: DescribePiiEntitiesDetectionJob -> String
showsPrec :: Int -> DescribePiiEntitiesDetectionJob -> ShowS
$cshowsPrec :: Int -> DescribePiiEntitiesDetectionJob -> ShowS
Prelude.Show, (forall x.
DescribePiiEntitiesDetectionJob
-> Rep DescribePiiEntitiesDetectionJob x)
-> (forall x.
Rep DescribePiiEntitiesDetectionJob x
-> DescribePiiEntitiesDetectionJob)
-> Generic DescribePiiEntitiesDetectionJob
forall x.
Rep DescribePiiEntitiesDetectionJob x
-> DescribePiiEntitiesDetectionJob
forall x.
DescribePiiEntitiesDetectionJob
-> Rep DescribePiiEntitiesDetectionJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePiiEntitiesDetectionJob x
-> DescribePiiEntitiesDetectionJob
$cfrom :: forall x.
DescribePiiEntitiesDetectionJob
-> Rep DescribePiiEntitiesDetectionJob x
Prelude.Generic)
newDescribePiiEntitiesDetectionJob ::
Prelude.Text ->
DescribePiiEntitiesDetectionJob
newDescribePiiEntitiesDetectionJob :: Text -> DescribePiiEntitiesDetectionJob
newDescribePiiEntitiesDetectionJob Text
pJobId_ =
DescribePiiEntitiesDetectionJob' :: Text -> DescribePiiEntitiesDetectionJob
DescribePiiEntitiesDetectionJob' {$sel:jobId:DescribePiiEntitiesDetectionJob' :: Text
jobId = Text
pJobId_}
describePiiEntitiesDetectionJob_jobId :: Lens.Lens' DescribePiiEntitiesDetectionJob Prelude.Text
describePiiEntitiesDetectionJob_jobId :: (Text -> f Text)
-> DescribePiiEntitiesDetectionJob
-> f DescribePiiEntitiesDetectionJob
describePiiEntitiesDetectionJob_jobId = (DescribePiiEntitiesDetectionJob -> Text)
-> (DescribePiiEntitiesDetectionJob
-> Text -> DescribePiiEntitiesDetectionJob)
-> Lens
DescribePiiEntitiesDetectionJob
DescribePiiEntitiesDetectionJob
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePiiEntitiesDetectionJob' {Text
jobId :: Text
$sel:jobId:DescribePiiEntitiesDetectionJob' :: DescribePiiEntitiesDetectionJob -> Text
jobId} -> Text
jobId) (\s :: DescribePiiEntitiesDetectionJob
s@DescribePiiEntitiesDetectionJob' {} Text
a -> DescribePiiEntitiesDetectionJob
s {$sel:jobId:DescribePiiEntitiesDetectionJob' :: Text
jobId = Text
a} :: DescribePiiEntitiesDetectionJob)
instance
Core.AWSRequest
DescribePiiEntitiesDetectionJob
where
type
AWSResponse DescribePiiEntitiesDetectionJob =
DescribePiiEntitiesDetectionJobResponse
request :: DescribePiiEntitiesDetectionJob
-> Request DescribePiiEntitiesDetectionJob
request = Service
-> DescribePiiEntitiesDetectionJob
-> Request DescribePiiEntitiesDetectionJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribePiiEntitiesDetectionJob
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribePiiEntitiesDetectionJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribePiiEntitiesDetectionJob))
-> Logger
-> Service
-> Proxy DescribePiiEntitiesDetectionJob
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribePiiEntitiesDetectionJob)))
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 PiiEntitiesDetectionJobProperties
-> Int -> DescribePiiEntitiesDetectionJobResponse
DescribePiiEntitiesDetectionJobResponse'
(Maybe PiiEntitiesDetectionJobProperties
-> Int -> DescribePiiEntitiesDetectionJobResponse)
-> Either String (Maybe PiiEntitiesDetectionJobProperties)
-> Either String (Int -> DescribePiiEntitiesDetectionJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe PiiEntitiesDetectionJobProperties)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PiiEntitiesDetectionJobProperties")
Either String (Int -> DescribePiiEntitiesDetectionJobResponse)
-> Either String Int
-> Either String DescribePiiEntitiesDetectionJobResponse
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
DescribePiiEntitiesDetectionJob
instance
Prelude.NFData
DescribePiiEntitiesDetectionJob
instance
Core.ToHeaders
DescribePiiEntitiesDetectionJob
where
toHeaders :: DescribePiiEntitiesDetectionJob -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribePiiEntitiesDetectionJob -> 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
"Comprehend_20171127.DescribePiiEntitiesDetectionJob" ::
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 DescribePiiEntitiesDetectionJob where
toJSON :: DescribePiiEntitiesDetectionJob -> Value
toJSON DescribePiiEntitiesDetectionJob' {Text
jobId :: Text
$sel:jobId:DescribePiiEntitiesDetectionJob' :: DescribePiiEntitiesDetectionJob -> 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
"JobId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobId)]
)
instance Core.ToPath DescribePiiEntitiesDetectionJob where
toPath :: DescribePiiEntitiesDetectionJob -> ByteString
toPath = ByteString -> DescribePiiEntitiesDetectionJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribePiiEntitiesDetectionJob where
toQuery :: DescribePiiEntitiesDetectionJob -> QueryString
toQuery = QueryString -> DescribePiiEntitiesDetectionJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribePiiEntitiesDetectionJobResponse = DescribePiiEntitiesDetectionJobResponse'
{ DescribePiiEntitiesDetectionJobResponse
-> Maybe PiiEntitiesDetectionJobProperties
piiEntitiesDetectionJobProperties :: Prelude.Maybe PiiEntitiesDetectionJobProperties,
DescribePiiEntitiesDetectionJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribePiiEntitiesDetectionJobResponse
-> DescribePiiEntitiesDetectionJobResponse -> Bool
(DescribePiiEntitiesDetectionJobResponse
-> DescribePiiEntitiesDetectionJobResponse -> Bool)
-> (DescribePiiEntitiesDetectionJobResponse
-> DescribePiiEntitiesDetectionJobResponse -> Bool)
-> Eq DescribePiiEntitiesDetectionJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePiiEntitiesDetectionJobResponse
-> DescribePiiEntitiesDetectionJobResponse -> Bool
$c/= :: DescribePiiEntitiesDetectionJobResponse
-> DescribePiiEntitiesDetectionJobResponse -> Bool
== :: DescribePiiEntitiesDetectionJobResponse
-> DescribePiiEntitiesDetectionJobResponse -> Bool
$c== :: DescribePiiEntitiesDetectionJobResponse
-> DescribePiiEntitiesDetectionJobResponse -> Bool
Prelude.Eq, ReadPrec [DescribePiiEntitiesDetectionJobResponse]
ReadPrec DescribePiiEntitiesDetectionJobResponse
Int -> ReadS DescribePiiEntitiesDetectionJobResponse
ReadS [DescribePiiEntitiesDetectionJobResponse]
(Int -> ReadS DescribePiiEntitiesDetectionJobResponse)
-> ReadS [DescribePiiEntitiesDetectionJobResponse]
-> ReadPrec DescribePiiEntitiesDetectionJobResponse
-> ReadPrec [DescribePiiEntitiesDetectionJobResponse]
-> Read DescribePiiEntitiesDetectionJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePiiEntitiesDetectionJobResponse]
$creadListPrec :: ReadPrec [DescribePiiEntitiesDetectionJobResponse]
readPrec :: ReadPrec DescribePiiEntitiesDetectionJobResponse
$creadPrec :: ReadPrec DescribePiiEntitiesDetectionJobResponse
readList :: ReadS [DescribePiiEntitiesDetectionJobResponse]
$creadList :: ReadS [DescribePiiEntitiesDetectionJobResponse]
readsPrec :: Int -> ReadS DescribePiiEntitiesDetectionJobResponse
$creadsPrec :: Int -> ReadS DescribePiiEntitiesDetectionJobResponse
Prelude.Read, Int -> DescribePiiEntitiesDetectionJobResponse -> ShowS
[DescribePiiEntitiesDetectionJobResponse] -> ShowS
DescribePiiEntitiesDetectionJobResponse -> String
(Int -> DescribePiiEntitiesDetectionJobResponse -> ShowS)
-> (DescribePiiEntitiesDetectionJobResponse -> String)
-> ([DescribePiiEntitiesDetectionJobResponse] -> ShowS)
-> Show DescribePiiEntitiesDetectionJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePiiEntitiesDetectionJobResponse] -> ShowS
$cshowList :: [DescribePiiEntitiesDetectionJobResponse] -> ShowS
show :: DescribePiiEntitiesDetectionJobResponse -> String
$cshow :: DescribePiiEntitiesDetectionJobResponse -> String
showsPrec :: Int -> DescribePiiEntitiesDetectionJobResponse -> ShowS
$cshowsPrec :: Int -> DescribePiiEntitiesDetectionJobResponse -> ShowS
Prelude.Show, (forall x.
DescribePiiEntitiesDetectionJobResponse
-> Rep DescribePiiEntitiesDetectionJobResponse x)
-> (forall x.
Rep DescribePiiEntitiesDetectionJobResponse x
-> DescribePiiEntitiesDetectionJobResponse)
-> Generic DescribePiiEntitiesDetectionJobResponse
forall x.
Rep DescribePiiEntitiesDetectionJobResponse x
-> DescribePiiEntitiesDetectionJobResponse
forall x.
DescribePiiEntitiesDetectionJobResponse
-> Rep DescribePiiEntitiesDetectionJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePiiEntitiesDetectionJobResponse x
-> DescribePiiEntitiesDetectionJobResponse
$cfrom :: forall x.
DescribePiiEntitiesDetectionJobResponse
-> Rep DescribePiiEntitiesDetectionJobResponse x
Prelude.Generic)
newDescribePiiEntitiesDetectionJobResponse ::
Prelude.Int ->
DescribePiiEntitiesDetectionJobResponse
newDescribePiiEntitiesDetectionJobResponse :: Int -> DescribePiiEntitiesDetectionJobResponse
newDescribePiiEntitiesDetectionJobResponse
Int
pHttpStatus_ =
DescribePiiEntitiesDetectionJobResponse' :: Maybe PiiEntitiesDetectionJobProperties
-> Int -> DescribePiiEntitiesDetectionJobResponse
DescribePiiEntitiesDetectionJobResponse'
{ $sel:piiEntitiesDetectionJobProperties:DescribePiiEntitiesDetectionJobResponse' :: Maybe PiiEntitiesDetectionJobProperties
piiEntitiesDetectionJobProperties =
Maybe PiiEntitiesDetectionJobProperties
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribePiiEntitiesDetectionJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describePiiEntitiesDetectionJobResponse_piiEntitiesDetectionJobProperties :: Lens.Lens' DescribePiiEntitiesDetectionJobResponse (Prelude.Maybe PiiEntitiesDetectionJobProperties)
describePiiEntitiesDetectionJobResponse_piiEntitiesDetectionJobProperties :: (Maybe PiiEntitiesDetectionJobProperties
-> f (Maybe PiiEntitiesDetectionJobProperties))
-> DescribePiiEntitiesDetectionJobResponse
-> f DescribePiiEntitiesDetectionJobResponse
describePiiEntitiesDetectionJobResponse_piiEntitiesDetectionJobProperties = (DescribePiiEntitiesDetectionJobResponse
-> Maybe PiiEntitiesDetectionJobProperties)
-> (DescribePiiEntitiesDetectionJobResponse
-> Maybe PiiEntitiesDetectionJobProperties
-> DescribePiiEntitiesDetectionJobResponse)
-> Lens
DescribePiiEntitiesDetectionJobResponse
DescribePiiEntitiesDetectionJobResponse
(Maybe PiiEntitiesDetectionJobProperties)
(Maybe PiiEntitiesDetectionJobProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePiiEntitiesDetectionJobResponse' {Maybe PiiEntitiesDetectionJobProperties
piiEntitiesDetectionJobProperties :: Maybe PiiEntitiesDetectionJobProperties
$sel:piiEntitiesDetectionJobProperties:DescribePiiEntitiesDetectionJobResponse' :: DescribePiiEntitiesDetectionJobResponse
-> Maybe PiiEntitiesDetectionJobProperties
piiEntitiesDetectionJobProperties} -> Maybe PiiEntitiesDetectionJobProperties
piiEntitiesDetectionJobProperties) (\s :: DescribePiiEntitiesDetectionJobResponse
s@DescribePiiEntitiesDetectionJobResponse' {} Maybe PiiEntitiesDetectionJobProperties
a -> DescribePiiEntitiesDetectionJobResponse
s {$sel:piiEntitiesDetectionJobProperties:DescribePiiEntitiesDetectionJobResponse' :: Maybe PiiEntitiesDetectionJobProperties
piiEntitiesDetectionJobProperties = Maybe PiiEntitiesDetectionJobProperties
a} :: DescribePiiEntitiesDetectionJobResponse)
describePiiEntitiesDetectionJobResponse_httpStatus :: Lens.Lens' DescribePiiEntitiesDetectionJobResponse Prelude.Int
describePiiEntitiesDetectionJobResponse_httpStatus :: (Int -> f Int)
-> DescribePiiEntitiesDetectionJobResponse
-> f DescribePiiEntitiesDetectionJobResponse
describePiiEntitiesDetectionJobResponse_httpStatus = (DescribePiiEntitiesDetectionJobResponse -> Int)
-> (DescribePiiEntitiesDetectionJobResponse
-> Int -> DescribePiiEntitiesDetectionJobResponse)
-> Lens
DescribePiiEntitiesDetectionJobResponse
DescribePiiEntitiesDetectionJobResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePiiEntitiesDetectionJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribePiiEntitiesDetectionJobResponse' :: DescribePiiEntitiesDetectionJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribePiiEntitiesDetectionJobResponse
s@DescribePiiEntitiesDetectionJobResponse' {} Int
a -> DescribePiiEntitiesDetectionJobResponse
s {$sel:httpStatus:DescribePiiEntitiesDetectionJobResponse' :: Int
httpStatus = Int
a} :: DescribePiiEntitiesDetectionJobResponse)
instance
Prelude.NFData
DescribePiiEntitiesDetectionJobResponse