{-# 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.ComprehendMedical.DescribeEntitiesDetectionV2Job
(
DescribeEntitiesDetectionV2Job (..),
newDescribeEntitiesDetectionV2Job,
describeEntitiesDetectionV2Job_jobId,
DescribeEntitiesDetectionV2JobResponse (..),
newDescribeEntitiesDetectionV2JobResponse,
describeEntitiesDetectionV2JobResponse_comprehendMedicalAsyncJobProperties,
describeEntitiesDetectionV2JobResponse_httpStatus,
)
where
import Amazonka.ComprehendMedical.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 DescribeEntitiesDetectionV2Job = DescribeEntitiesDetectionV2Job'
{
DescribeEntitiesDetectionV2Job -> Text
jobId :: Prelude.Text
}
deriving (DescribeEntitiesDetectionV2Job
-> DescribeEntitiesDetectionV2Job -> Bool
(DescribeEntitiesDetectionV2Job
-> DescribeEntitiesDetectionV2Job -> Bool)
-> (DescribeEntitiesDetectionV2Job
-> DescribeEntitiesDetectionV2Job -> Bool)
-> Eq DescribeEntitiesDetectionV2Job
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEntitiesDetectionV2Job
-> DescribeEntitiesDetectionV2Job -> Bool
$c/= :: DescribeEntitiesDetectionV2Job
-> DescribeEntitiesDetectionV2Job -> Bool
== :: DescribeEntitiesDetectionV2Job
-> DescribeEntitiesDetectionV2Job -> Bool
$c== :: DescribeEntitiesDetectionV2Job
-> DescribeEntitiesDetectionV2Job -> Bool
Prelude.Eq, ReadPrec [DescribeEntitiesDetectionV2Job]
ReadPrec DescribeEntitiesDetectionV2Job
Int -> ReadS DescribeEntitiesDetectionV2Job
ReadS [DescribeEntitiesDetectionV2Job]
(Int -> ReadS DescribeEntitiesDetectionV2Job)
-> ReadS [DescribeEntitiesDetectionV2Job]
-> ReadPrec DescribeEntitiesDetectionV2Job
-> ReadPrec [DescribeEntitiesDetectionV2Job]
-> Read DescribeEntitiesDetectionV2Job
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEntitiesDetectionV2Job]
$creadListPrec :: ReadPrec [DescribeEntitiesDetectionV2Job]
readPrec :: ReadPrec DescribeEntitiesDetectionV2Job
$creadPrec :: ReadPrec DescribeEntitiesDetectionV2Job
readList :: ReadS [DescribeEntitiesDetectionV2Job]
$creadList :: ReadS [DescribeEntitiesDetectionV2Job]
readsPrec :: Int -> ReadS DescribeEntitiesDetectionV2Job
$creadsPrec :: Int -> ReadS DescribeEntitiesDetectionV2Job
Prelude.Read, Int -> DescribeEntitiesDetectionV2Job -> ShowS
[DescribeEntitiesDetectionV2Job] -> ShowS
DescribeEntitiesDetectionV2Job -> String
(Int -> DescribeEntitiesDetectionV2Job -> ShowS)
-> (DescribeEntitiesDetectionV2Job -> String)
-> ([DescribeEntitiesDetectionV2Job] -> ShowS)
-> Show DescribeEntitiesDetectionV2Job
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEntitiesDetectionV2Job] -> ShowS
$cshowList :: [DescribeEntitiesDetectionV2Job] -> ShowS
show :: DescribeEntitiesDetectionV2Job -> String
$cshow :: DescribeEntitiesDetectionV2Job -> String
showsPrec :: Int -> DescribeEntitiesDetectionV2Job -> ShowS
$cshowsPrec :: Int -> DescribeEntitiesDetectionV2Job -> ShowS
Prelude.Show, (forall x.
DescribeEntitiesDetectionV2Job
-> Rep DescribeEntitiesDetectionV2Job x)
-> (forall x.
Rep DescribeEntitiesDetectionV2Job x
-> DescribeEntitiesDetectionV2Job)
-> Generic DescribeEntitiesDetectionV2Job
forall x.
Rep DescribeEntitiesDetectionV2Job x
-> DescribeEntitiesDetectionV2Job
forall x.
DescribeEntitiesDetectionV2Job
-> Rep DescribeEntitiesDetectionV2Job x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEntitiesDetectionV2Job x
-> DescribeEntitiesDetectionV2Job
$cfrom :: forall x.
DescribeEntitiesDetectionV2Job
-> Rep DescribeEntitiesDetectionV2Job x
Prelude.Generic)
newDescribeEntitiesDetectionV2Job ::
Prelude.Text ->
DescribeEntitiesDetectionV2Job
newDescribeEntitiesDetectionV2Job :: Text -> DescribeEntitiesDetectionV2Job
newDescribeEntitiesDetectionV2Job Text
pJobId_ =
DescribeEntitiesDetectionV2Job' :: Text -> DescribeEntitiesDetectionV2Job
DescribeEntitiesDetectionV2Job' {$sel:jobId:DescribeEntitiesDetectionV2Job' :: Text
jobId = Text
pJobId_}
describeEntitiesDetectionV2Job_jobId :: Lens.Lens' DescribeEntitiesDetectionV2Job Prelude.Text
describeEntitiesDetectionV2Job_jobId :: (Text -> f Text)
-> DescribeEntitiesDetectionV2Job
-> f DescribeEntitiesDetectionV2Job
describeEntitiesDetectionV2Job_jobId = (DescribeEntitiesDetectionV2Job -> Text)
-> (DescribeEntitiesDetectionV2Job
-> Text -> DescribeEntitiesDetectionV2Job)
-> Lens
DescribeEntitiesDetectionV2Job
DescribeEntitiesDetectionV2Job
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEntitiesDetectionV2Job' {Text
jobId :: Text
$sel:jobId:DescribeEntitiesDetectionV2Job' :: DescribeEntitiesDetectionV2Job -> Text
jobId} -> Text
jobId) (\s :: DescribeEntitiesDetectionV2Job
s@DescribeEntitiesDetectionV2Job' {} Text
a -> DescribeEntitiesDetectionV2Job
s {$sel:jobId:DescribeEntitiesDetectionV2Job' :: Text
jobId = Text
a} :: DescribeEntitiesDetectionV2Job)
instance
Core.AWSRequest
DescribeEntitiesDetectionV2Job
where
type
AWSResponse DescribeEntitiesDetectionV2Job =
DescribeEntitiesDetectionV2JobResponse
request :: DescribeEntitiesDetectionV2Job
-> Request DescribeEntitiesDetectionV2Job
request = Service
-> DescribeEntitiesDetectionV2Job
-> Request DescribeEntitiesDetectionV2Job
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeEntitiesDetectionV2Job
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeEntitiesDetectionV2Job)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeEntitiesDetectionV2Job))
-> Logger
-> Service
-> Proxy DescribeEntitiesDetectionV2Job
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeEntitiesDetectionV2Job)))
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 ComprehendMedicalAsyncJobProperties
-> Int -> DescribeEntitiesDetectionV2JobResponse
DescribeEntitiesDetectionV2JobResponse'
(Maybe ComprehendMedicalAsyncJobProperties
-> Int -> DescribeEntitiesDetectionV2JobResponse)
-> Either String (Maybe ComprehendMedicalAsyncJobProperties)
-> Either String (Int -> DescribeEntitiesDetectionV2JobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe ComprehendMedicalAsyncJobProperties)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ComprehendMedicalAsyncJobProperties")
Either String (Int -> DescribeEntitiesDetectionV2JobResponse)
-> Either String Int
-> Either String DescribeEntitiesDetectionV2JobResponse
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
DescribeEntitiesDetectionV2Job
instance
Prelude.NFData
DescribeEntitiesDetectionV2Job
instance
Core.ToHeaders
DescribeEntitiesDetectionV2Job
where
toHeaders :: DescribeEntitiesDetectionV2Job -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeEntitiesDetectionV2Job -> 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
"ComprehendMedical_20181030.DescribeEntitiesDetectionV2Job" ::
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 DescribeEntitiesDetectionV2Job where
toJSON :: DescribeEntitiesDetectionV2Job -> Value
toJSON DescribeEntitiesDetectionV2Job' {Text
jobId :: Text
$sel:jobId:DescribeEntitiesDetectionV2Job' :: DescribeEntitiesDetectionV2Job -> 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 DescribeEntitiesDetectionV2Job where
toPath :: DescribeEntitiesDetectionV2Job -> ByteString
toPath = ByteString -> DescribeEntitiesDetectionV2Job -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeEntitiesDetectionV2Job where
toQuery :: DescribeEntitiesDetectionV2Job -> QueryString
toQuery = QueryString -> DescribeEntitiesDetectionV2Job -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeEntitiesDetectionV2JobResponse = DescribeEntitiesDetectionV2JobResponse'
{
DescribeEntitiesDetectionV2JobResponse
-> Maybe ComprehendMedicalAsyncJobProperties
comprehendMedicalAsyncJobProperties :: Prelude.Maybe ComprehendMedicalAsyncJobProperties,
DescribeEntitiesDetectionV2JobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeEntitiesDetectionV2JobResponse
-> DescribeEntitiesDetectionV2JobResponse -> Bool
(DescribeEntitiesDetectionV2JobResponse
-> DescribeEntitiesDetectionV2JobResponse -> Bool)
-> (DescribeEntitiesDetectionV2JobResponse
-> DescribeEntitiesDetectionV2JobResponse -> Bool)
-> Eq DescribeEntitiesDetectionV2JobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEntitiesDetectionV2JobResponse
-> DescribeEntitiesDetectionV2JobResponse -> Bool
$c/= :: DescribeEntitiesDetectionV2JobResponse
-> DescribeEntitiesDetectionV2JobResponse -> Bool
== :: DescribeEntitiesDetectionV2JobResponse
-> DescribeEntitiesDetectionV2JobResponse -> Bool
$c== :: DescribeEntitiesDetectionV2JobResponse
-> DescribeEntitiesDetectionV2JobResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEntitiesDetectionV2JobResponse]
ReadPrec DescribeEntitiesDetectionV2JobResponse
Int -> ReadS DescribeEntitiesDetectionV2JobResponse
ReadS [DescribeEntitiesDetectionV2JobResponse]
(Int -> ReadS DescribeEntitiesDetectionV2JobResponse)
-> ReadS [DescribeEntitiesDetectionV2JobResponse]
-> ReadPrec DescribeEntitiesDetectionV2JobResponse
-> ReadPrec [DescribeEntitiesDetectionV2JobResponse]
-> Read DescribeEntitiesDetectionV2JobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEntitiesDetectionV2JobResponse]
$creadListPrec :: ReadPrec [DescribeEntitiesDetectionV2JobResponse]
readPrec :: ReadPrec DescribeEntitiesDetectionV2JobResponse
$creadPrec :: ReadPrec DescribeEntitiesDetectionV2JobResponse
readList :: ReadS [DescribeEntitiesDetectionV2JobResponse]
$creadList :: ReadS [DescribeEntitiesDetectionV2JobResponse]
readsPrec :: Int -> ReadS DescribeEntitiesDetectionV2JobResponse
$creadsPrec :: Int -> ReadS DescribeEntitiesDetectionV2JobResponse
Prelude.Read, Int -> DescribeEntitiesDetectionV2JobResponse -> ShowS
[DescribeEntitiesDetectionV2JobResponse] -> ShowS
DescribeEntitiesDetectionV2JobResponse -> String
(Int -> DescribeEntitiesDetectionV2JobResponse -> ShowS)
-> (DescribeEntitiesDetectionV2JobResponse -> String)
-> ([DescribeEntitiesDetectionV2JobResponse] -> ShowS)
-> Show DescribeEntitiesDetectionV2JobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEntitiesDetectionV2JobResponse] -> ShowS
$cshowList :: [DescribeEntitiesDetectionV2JobResponse] -> ShowS
show :: DescribeEntitiesDetectionV2JobResponse -> String
$cshow :: DescribeEntitiesDetectionV2JobResponse -> String
showsPrec :: Int -> DescribeEntitiesDetectionV2JobResponse -> ShowS
$cshowsPrec :: Int -> DescribeEntitiesDetectionV2JobResponse -> ShowS
Prelude.Show, (forall x.
DescribeEntitiesDetectionV2JobResponse
-> Rep DescribeEntitiesDetectionV2JobResponse x)
-> (forall x.
Rep DescribeEntitiesDetectionV2JobResponse x
-> DescribeEntitiesDetectionV2JobResponse)
-> Generic DescribeEntitiesDetectionV2JobResponse
forall x.
Rep DescribeEntitiesDetectionV2JobResponse x
-> DescribeEntitiesDetectionV2JobResponse
forall x.
DescribeEntitiesDetectionV2JobResponse
-> Rep DescribeEntitiesDetectionV2JobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEntitiesDetectionV2JobResponse x
-> DescribeEntitiesDetectionV2JobResponse
$cfrom :: forall x.
DescribeEntitiesDetectionV2JobResponse
-> Rep DescribeEntitiesDetectionV2JobResponse x
Prelude.Generic)
newDescribeEntitiesDetectionV2JobResponse ::
Prelude.Int ->
DescribeEntitiesDetectionV2JobResponse
newDescribeEntitiesDetectionV2JobResponse :: Int -> DescribeEntitiesDetectionV2JobResponse
newDescribeEntitiesDetectionV2JobResponse
Int
pHttpStatus_ =
DescribeEntitiesDetectionV2JobResponse' :: Maybe ComprehendMedicalAsyncJobProperties
-> Int -> DescribeEntitiesDetectionV2JobResponse
DescribeEntitiesDetectionV2JobResponse'
{ $sel:comprehendMedicalAsyncJobProperties:DescribeEntitiesDetectionV2JobResponse' :: Maybe ComprehendMedicalAsyncJobProperties
comprehendMedicalAsyncJobProperties =
Maybe ComprehendMedicalAsyncJobProperties
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeEntitiesDetectionV2JobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeEntitiesDetectionV2JobResponse_comprehendMedicalAsyncJobProperties :: Lens.Lens' DescribeEntitiesDetectionV2JobResponse (Prelude.Maybe ComprehendMedicalAsyncJobProperties)
describeEntitiesDetectionV2JobResponse_comprehendMedicalAsyncJobProperties :: (Maybe ComprehendMedicalAsyncJobProperties
-> f (Maybe ComprehendMedicalAsyncJobProperties))
-> DescribeEntitiesDetectionV2JobResponse
-> f DescribeEntitiesDetectionV2JobResponse
describeEntitiesDetectionV2JobResponse_comprehendMedicalAsyncJobProperties = (DescribeEntitiesDetectionV2JobResponse
-> Maybe ComprehendMedicalAsyncJobProperties)
-> (DescribeEntitiesDetectionV2JobResponse
-> Maybe ComprehendMedicalAsyncJobProperties
-> DescribeEntitiesDetectionV2JobResponse)
-> Lens
DescribeEntitiesDetectionV2JobResponse
DescribeEntitiesDetectionV2JobResponse
(Maybe ComprehendMedicalAsyncJobProperties)
(Maybe ComprehendMedicalAsyncJobProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEntitiesDetectionV2JobResponse' {Maybe ComprehendMedicalAsyncJobProperties
comprehendMedicalAsyncJobProperties :: Maybe ComprehendMedicalAsyncJobProperties
$sel:comprehendMedicalAsyncJobProperties:DescribeEntitiesDetectionV2JobResponse' :: DescribeEntitiesDetectionV2JobResponse
-> Maybe ComprehendMedicalAsyncJobProperties
comprehendMedicalAsyncJobProperties} -> Maybe ComprehendMedicalAsyncJobProperties
comprehendMedicalAsyncJobProperties) (\s :: DescribeEntitiesDetectionV2JobResponse
s@DescribeEntitiesDetectionV2JobResponse' {} Maybe ComprehendMedicalAsyncJobProperties
a -> DescribeEntitiesDetectionV2JobResponse
s {$sel:comprehendMedicalAsyncJobProperties:DescribeEntitiesDetectionV2JobResponse' :: Maybe ComprehendMedicalAsyncJobProperties
comprehendMedicalAsyncJobProperties = Maybe ComprehendMedicalAsyncJobProperties
a} :: DescribeEntitiesDetectionV2JobResponse)
describeEntitiesDetectionV2JobResponse_httpStatus :: Lens.Lens' DescribeEntitiesDetectionV2JobResponse Prelude.Int
describeEntitiesDetectionV2JobResponse_httpStatus :: (Int -> f Int)
-> DescribeEntitiesDetectionV2JobResponse
-> f DescribeEntitiesDetectionV2JobResponse
describeEntitiesDetectionV2JobResponse_httpStatus = (DescribeEntitiesDetectionV2JobResponse -> Int)
-> (DescribeEntitiesDetectionV2JobResponse
-> Int -> DescribeEntitiesDetectionV2JobResponse)
-> Lens
DescribeEntitiesDetectionV2JobResponse
DescribeEntitiesDetectionV2JobResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEntitiesDetectionV2JobResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeEntitiesDetectionV2JobResponse' :: DescribeEntitiesDetectionV2JobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeEntitiesDetectionV2JobResponse
s@DescribeEntitiesDetectionV2JobResponse' {} Int
a -> DescribeEntitiesDetectionV2JobResponse
s {$sel:httpStatus:DescribeEntitiesDetectionV2JobResponse' :: Int
httpStatus = Int
a} :: DescribeEntitiesDetectionV2JobResponse)
instance
Prelude.NFData
DescribeEntitiesDetectionV2JobResponse