{-# 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.DescribeEntityRecognizer
(
DescribeEntityRecognizer (..),
newDescribeEntityRecognizer,
describeEntityRecognizer_entityRecognizerArn,
DescribeEntityRecognizerResponse (..),
newDescribeEntityRecognizerResponse,
describeEntityRecognizerResponse_entityRecognizerProperties,
describeEntityRecognizerResponse_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 DescribeEntityRecognizer = DescribeEntityRecognizer'
{
DescribeEntityRecognizer -> Text
entityRecognizerArn :: Prelude.Text
}
deriving (DescribeEntityRecognizer -> DescribeEntityRecognizer -> Bool
(DescribeEntityRecognizer -> DescribeEntityRecognizer -> Bool)
-> (DescribeEntityRecognizer -> DescribeEntityRecognizer -> Bool)
-> Eq DescribeEntityRecognizer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEntityRecognizer -> DescribeEntityRecognizer -> Bool
$c/= :: DescribeEntityRecognizer -> DescribeEntityRecognizer -> Bool
== :: DescribeEntityRecognizer -> DescribeEntityRecognizer -> Bool
$c== :: DescribeEntityRecognizer -> DescribeEntityRecognizer -> Bool
Prelude.Eq, ReadPrec [DescribeEntityRecognizer]
ReadPrec DescribeEntityRecognizer
Int -> ReadS DescribeEntityRecognizer
ReadS [DescribeEntityRecognizer]
(Int -> ReadS DescribeEntityRecognizer)
-> ReadS [DescribeEntityRecognizer]
-> ReadPrec DescribeEntityRecognizer
-> ReadPrec [DescribeEntityRecognizer]
-> Read DescribeEntityRecognizer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEntityRecognizer]
$creadListPrec :: ReadPrec [DescribeEntityRecognizer]
readPrec :: ReadPrec DescribeEntityRecognizer
$creadPrec :: ReadPrec DescribeEntityRecognizer
readList :: ReadS [DescribeEntityRecognizer]
$creadList :: ReadS [DescribeEntityRecognizer]
readsPrec :: Int -> ReadS DescribeEntityRecognizer
$creadsPrec :: Int -> ReadS DescribeEntityRecognizer
Prelude.Read, Int -> DescribeEntityRecognizer -> ShowS
[DescribeEntityRecognizer] -> ShowS
DescribeEntityRecognizer -> String
(Int -> DescribeEntityRecognizer -> ShowS)
-> (DescribeEntityRecognizer -> String)
-> ([DescribeEntityRecognizer] -> ShowS)
-> Show DescribeEntityRecognizer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEntityRecognizer] -> ShowS
$cshowList :: [DescribeEntityRecognizer] -> ShowS
show :: DescribeEntityRecognizer -> String
$cshow :: DescribeEntityRecognizer -> String
showsPrec :: Int -> DescribeEntityRecognizer -> ShowS
$cshowsPrec :: Int -> DescribeEntityRecognizer -> ShowS
Prelude.Show, (forall x.
DescribeEntityRecognizer -> Rep DescribeEntityRecognizer x)
-> (forall x.
Rep DescribeEntityRecognizer x -> DescribeEntityRecognizer)
-> Generic DescribeEntityRecognizer
forall x.
Rep DescribeEntityRecognizer x -> DescribeEntityRecognizer
forall x.
DescribeEntityRecognizer -> Rep DescribeEntityRecognizer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEntityRecognizer x -> DescribeEntityRecognizer
$cfrom :: forall x.
DescribeEntityRecognizer -> Rep DescribeEntityRecognizer x
Prelude.Generic)
newDescribeEntityRecognizer ::
Prelude.Text ->
DescribeEntityRecognizer
newDescribeEntityRecognizer :: Text -> DescribeEntityRecognizer
newDescribeEntityRecognizer Text
pEntityRecognizerArn_ =
DescribeEntityRecognizer' :: Text -> DescribeEntityRecognizer
DescribeEntityRecognizer'
{ $sel:entityRecognizerArn:DescribeEntityRecognizer' :: Text
entityRecognizerArn =
Text
pEntityRecognizerArn_
}
describeEntityRecognizer_entityRecognizerArn :: Lens.Lens' DescribeEntityRecognizer Prelude.Text
describeEntityRecognizer_entityRecognizerArn :: (Text -> f Text)
-> DescribeEntityRecognizer -> f DescribeEntityRecognizer
describeEntityRecognizer_entityRecognizerArn = (DescribeEntityRecognizer -> Text)
-> (DescribeEntityRecognizer -> Text -> DescribeEntityRecognizer)
-> Lens DescribeEntityRecognizer DescribeEntityRecognizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEntityRecognizer' {Text
entityRecognizerArn :: Text
$sel:entityRecognizerArn:DescribeEntityRecognizer' :: DescribeEntityRecognizer -> Text
entityRecognizerArn} -> Text
entityRecognizerArn) (\s :: DescribeEntityRecognizer
s@DescribeEntityRecognizer' {} Text
a -> DescribeEntityRecognizer
s {$sel:entityRecognizerArn:DescribeEntityRecognizer' :: Text
entityRecognizerArn = Text
a} :: DescribeEntityRecognizer)
instance Core.AWSRequest DescribeEntityRecognizer where
type
AWSResponse DescribeEntityRecognizer =
DescribeEntityRecognizerResponse
request :: DescribeEntityRecognizer -> Request DescribeEntityRecognizer
request = Service
-> DescribeEntityRecognizer -> Request DescribeEntityRecognizer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeEntityRecognizer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeEntityRecognizer)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeEntityRecognizer))
-> Logger
-> Service
-> Proxy DescribeEntityRecognizer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeEntityRecognizer)))
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 EntityRecognizerProperties
-> Int -> DescribeEntityRecognizerResponse
DescribeEntityRecognizerResponse'
(Maybe EntityRecognizerProperties
-> Int -> DescribeEntityRecognizerResponse)
-> Either String (Maybe EntityRecognizerProperties)
-> Either String (Int -> DescribeEntityRecognizerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe EntityRecognizerProperties)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EntityRecognizerProperties")
Either String (Int -> DescribeEntityRecognizerResponse)
-> Either String Int
-> Either String DescribeEntityRecognizerResponse
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 DescribeEntityRecognizer
instance Prelude.NFData DescribeEntityRecognizer
instance Core.ToHeaders DescribeEntityRecognizer where
toHeaders :: DescribeEntityRecognizer -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeEntityRecognizer -> 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.DescribeEntityRecognizer" ::
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 DescribeEntityRecognizer where
toJSON :: DescribeEntityRecognizer -> Value
toJSON DescribeEntityRecognizer' {Text
entityRecognizerArn :: Text
$sel:entityRecognizerArn:DescribeEntityRecognizer' :: DescribeEntityRecognizer -> 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
"EntityRecognizerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
entityRecognizerArn)
]
)
instance Core.ToPath DescribeEntityRecognizer where
toPath :: DescribeEntityRecognizer -> ByteString
toPath = ByteString -> DescribeEntityRecognizer -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeEntityRecognizer where
toQuery :: DescribeEntityRecognizer -> QueryString
toQuery = QueryString -> DescribeEntityRecognizer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeEntityRecognizerResponse = DescribeEntityRecognizerResponse'
{
DescribeEntityRecognizerResponse
-> Maybe EntityRecognizerProperties
entityRecognizerProperties :: Prelude.Maybe EntityRecognizerProperties,
DescribeEntityRecognizerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeEntityRecognizerResponse
-> DescribeEntityRecognizerResponse -> Bool
(DescribeEntityRecognizerResponse
-> DescribeEntityRecognizerResponse -> Bool)
-> (DescribeEntityRecognizerResponse
-> DescribeEntityRecognizerResponse -> Bool)
-> Eq DescribeEntityRecognizerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEntityRecognizerResponse
-> DescribeEntityRecognizerResponse -> Bool
$c/= :: DescribeEntityRecognizerResponse
-> DescribeEntityRecognizerResponse -> Bool
== :: DescribeEntityRecognizerResponse
-> DescribeEntityRecognizerResponse -> Bool
$c== :: DescribeEntityRecognizerResponse
-> DescribeEntityRecognizerResponse -> Bool
Prelude.Eq, Int -> DescribeEntityRecognizerResponse -> ShowS
[DescribeEntityRecognizerResponse] -> ShowS
DescribeEntityRecognizerResponse -> String
(Int -> DescribeEntityRecognizerResponse -> ShowS)
-> (DescribeEntityRecognizerResponse -> String)
-> ([DescribeEntityRecognizerResponse] -> ShowS)
-> Show DescribeEntityRecognizerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEntityRecognizerResponse] -> ShowS
$cshowList :: [DescribeEntityRecognizerResponse] -> ShowS
show :: DescribeEntityRecognizerResponse -> String
$cshow :: DescribeEntityRecognizerResponse -> String
showsPrec :: Int -> DescribeEntityRecognizerResponse -> ShowS
$cshowsPrec :: Int -> DescribeEntityRecognizerResponse -> ShowS
Prelude.Show, (forall x.
DescribeEntityRecognizerResponse
-> Rep DescribeEntityRecognizerResponse x)
-> (forall x.
Rep DescribeEntityRecognizerResponse x
-> DescribeEntityRecognizerResponse)
-> Generic DescribeEntityRecognizerResponse
forall x.
Rep DescribeEntityRecognizerResponse x
-> DescribeEntityRecognizerResponse
forall x.
DescribeEntityRecognizerResponse
-> Rep DescribeEntityRecognizerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEntityRecognizerResponse x
-> DescribeEntityRecognizerResponse
$cfrom :: forall x.
DescribeEntityRecognizerResponse
-> Rep DescribeEntityRecognizerResponse x
Prelude.Generic)
newDescribeEntityRecognizerResponse ::
Prelude.Int ->
DescribeEntityRecognizerResponse
newDescribeEntityRecognizerResponse :: Int -> DescribeEntityRecognizerResponse
newDescribeEntityRecognizerResponse Int
pHttpStatus_ =
DescribeEntityRecognizerResponse' :: Maybe EntityRecognizerProperties
-> Int -> DescribeEntityRecognizerResponse
DescribeEntityRecognizerResponse'
{ $sel:entityRecognizerProperties:DescribeEntityRecognizerResponse' :: Maybe EntityRecognizerProperties
entityRecognizerProperties =
Maybe EntityRecognizerProperties
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeEntityRecognizerResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeEntityRecognizerResponse_entityRecognizerProperties :: Lens.Lens' DescribeEntityRecognizerResponse (Prelude.Maybe EntityRecognizerProperties)
describeEntityRecognizerResponse_entityRecognizerProperties :: (Maybe EntityRecognizerProperties
-> f (Maybe EntityRecognizerProperties))
-> DescribeEntityRecognizerResponse
-> f DescribeEntityRecognizerResponse
describeEntityRecognizerResponse_entityRecognizerProperties = (DescribeEntityRecognizerResponse
-> Maybe EntityRecognizerProperties)
-> (DescribeEntityRecognizerResponse
-> Maybe EntityRecognizerProperties
-> DescribeEntityRecognizerResponse)
-> Lens
DescribeEntityRecognizerResponse
DescribeEntityRecognizerResponse
(Maybe EntityRecognizerProperties)
(Maybe EntityRecognizerProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEntityRecognizerResponse' {Maybe EntityRecognizerProperties
entityRecognizerProperties :: Maybe EntityRecognizerProperties
$sel:entityRecognizerProperties:DescribeEntityRecognizerResponse' :: DescribeEntityRecognizerResponse
-> Maybe EntityRecognizerProperties
entityRecognizerProperties} -> Maybe EntityRecognizerProperties
entityRecognizerProperties) (\s :: DescribeEntityRecognizerResponse
s@DescribeEntityRecognizerResponse' {} Maybe EntityRecognizerProperties
a -> DescribeEntityRecognizerResponse
s {$sel:entityRecognizerProperties:DescribeEntityRecognizerResponse' :: Maybe EntityRecognizerProperties
entityRecognizerProperties = Maybe EntityRecognizerProperties
a} :: DescribeEntityRecognizerResponse)
describeEntityRecognizerResponse_httpStatus :: Lens.Lens' DescribeEntityRecognizerResponse Prelude.Int
describeEntityRecognizerResponse_httpStatus :: (Int -> f Int)
-> DescribeEntityRecognizerResponse
-> f DescribeEntityRecognizerResponse
describeEntityRecognizerResponse_httpStatus = (DescribeEntityRecognizerResponse -> Int)
-> (DescribeEntityRecognizerResponse
-> Int -> DescribeEntityRecognizerResponse)
-> Lens
DescribeEntityRecognizerResponse
DescribeEntityRecognizerResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEntityRecognizerResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeEntityRecognizerResponse' :: DescribeEntityRecognizerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeEntityRecognizerResponse
s@DescribeEntityRecognizerResponse' {} Int
a -> DescribeEntityRecognizerResponse
s {$sel:httpStatus:DescribeEntityRecognizerResponse' :: Int
httpStatus = Int
a} :: DescribeEntityRecognizerResponse)
instance
Prelude.NFData
DescribeEntityRecognizerResponse