{-# 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.CreateEntityRecognizer
(
CreateEntityRecognizer (..),
newCreateEntityRecognizer,
createEntityRecognizer_versionName,
createEntityRecognizer_modelKmsKeyId,
createEntityRecognizer_vpcConfig,
createEntityRecognizer_volumeKmsKeyId,
createEntityRecognizer_clientRequestToken,
createEntityRecognizer_tags,
createEntityRecognizer_recognizerName,
createEntityRecognizer_dataAccessRoleArn,
createEntityRecognizer_inputDataConfig,
createEntityRecognizer_languageCode,
CreateEntityRecognizerResponse (..),
newCreateEntityRecognizerResponse,
createEntityRecognizerResponse_entityRecognizerArn,
createEntityRecognizerResponse_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 CreateEntityRecognizer = CreateEntityRecognizer'
{
CreateEntityRecognizer -> Maybe Text
versionName :: Prelude.Maybe Prelude.Text,
CreateEntityRecognizer -> Maybe Text
modelKmsKeyId :: Prelude.Maybe Prelude.Text,
CreateEntityRecognizer -> Maybe VpcConfig
vpcConfig :: Prelude.Maybe VpcConfig,
CreateEntityRecognizer -> Maybe Text
volumeKmsKeyId :: Prelude.Maybe Prelude.Text,
CreateEntityRecognizer -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
CreateEntityRecognizer -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateEntityRecognizer -> Text
recognizerName :: Prelude.Text,
CreateEntityRecognizer -> Text
dataAccessRoleArn :: Prelude.Text,
CreateEntityRecognizer -> EntityRecognizerInputDataConfig
inputDataConfig :: EntityRecognizerInputDataConfig,
CreateEntityRecognizer -> LanguageCode
languageCode :: LanguageCode
}
deriving (CreateEntityRecognizer -> CreateEntityRecognizer -> Bool
(CreateEntityRecognizer -> CreateEntityRecognizer -> Bool)
-> (CreateEntityRecognizer -> CreateEntityRecognizer -> Bool)
-> Eq CreateEntityRecognizer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEntityRecognizer -> CreateEntityRecognizer -> Bool
$c/= :: CreateEntityRecognizer -> CreateEntityRecognizer -> Bool
== :: CreateEntityRecognizer -> CreateEntityRecognizer -> Bool
$c== :: CreateEntityRecognizer -> CreateEntityRecognizer -> Bool
Prelude.Eq, ReadPrec [CreateEntityRecognizer]
ReadPrec CreateEntityRecognizer
Int -> ReadS CreateEntityRecognizer
ReadS [CreateEntityRecognizer]
(Int -> ReadS CreateEntityRecognizer)
-> ReadS [CreateEntityRecognizer]
-> ReadPrec CreateEntityRecognizer
-> ReadPrec [CreateEntityRecognizer]
-> Read CreateEntityRecognizer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEntityRecognizer]
$creadListPrec :: ReadPrec [CreateEntityRecognizer]
readPrec :: ReadPrec CreateEntityRecognizer
$creadPrec :: ReadPrec CreateEntityRecognizer
readList :: ReadS [CreateEntityRecognizer]
$creadList :: ReadS [CreateEntityRecognizer]
readsPrec :: Int -> ReadS CreateEntityRecognizer
$creadsPrec :: Int -> ReadS CreateEntityRecognizer
Prelude.Read, Int -> CreateEntityRecognizer -> ShowS
[CreateEntityRecognizer] -> ShowS
CreateEntityRecognizer -> String
(Int -> CreateEntityRecognizer -> ShowS)
-> (CreateEntityRecognizer -> String)
-> ([CreateEntityRecognizer] -> ShowS)
-> Show CreateEntityRecognizer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEntityRecognizer] -> ShowS
$cshowList :: [CreateEntityRecognizer] -> ShowS
show :: CreateEntityRecognizer -> String
$cshow :: CreateEntityRecognizer -> String
showsPrec :: Int -> CreateEntityRecognizer -> ShowS
$cshowsPrec :: Int -> CreateEntityRecognizer -> ShowS
Prelude.Show, (forall x. CreateEntityRecognizer -> Rep CreateEntityRecognizer x)
-> (forall x.
Rep CreateEntityRecognizer x -> CreateEntityRecognizer)
-> Generic CreateEntityRecognizer
forall x. Rep CreateEntityRecognizer x -> CreateEntityRecognizer
forall x. CreateEntityRecognizer -> Rep CreateEntityRecognizer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateEntityRecognizer x -> CreateEntityRecognizer
$cfrom :: forall x. CreateEntityRecognizer -> Rep CreateEntityRecognizer x
Prelude.Generic)
newCreateEntityRecognizer ::
Prelude.Text ->
Prelude.Text ->
EntityRecognizerInputDataConfig ->
LanguageCode ->
CreateEntityRecognizer
newCreateEntityRecognizer :: Text
-> Text
-> EntityRecognizerInputDataConfig
-> LanguageCode
-> CreateEntityRecognizer
newCreateEntityRecognizer
Text
pRecognizerName_
Text
pDataAccessRoleArn_
EntityRecognizerInputDataConfig
pInputDataConfig_
LanguageCode
pLanguageCode_ =
CreateEntityRecognizer' :: Maybe Text
-> Maybe Text
-> Maybe VpcConfig
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> EntityRecognizerInputDataConfig
-> LanguageCode
-> CreateEntityRecognizer
CreateEntityRecognizer'
{ $sel:versionName:CreateEntityRecognizer' :: Maybe Text
versionName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:modelKmsKeyId:CreateEntityRecognizer' :: Maybe Text
modelKmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:vpcConfig:CreateEntityRecognizer' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
forall a. Maybe a
Prelude.Nothing,
$sel:volumeKmsKeyId:CreateEntityRecognizer' :: Maybe Text
volumeKmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:CreateEntityRecognizer' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateEntityRecognizer' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:recognizerName:CreateEntityRecognizer' :: Text
recognizerName = Text
pRecognizerName_,
$sel:dataAccessRoleArn:CreateEntityRecognizer' :: Text
dataAccessRoleArn = Text
pDataAccessRoleArn_,
$sel:inputDataConfig:CreateEntityRecognizer' :: EntityRecognizerInputDataConfig
inputDataConfig = EntityRecognizerInputDataConfig
pInputDataConfig_,
$sel:languageCode:CreateEntityRecognizer' :: LanguageCode
languageCode = LanguageCode
pLanguageCode_
}
createEntityRecognizer_versionName :: Lens.Lens' CreateEntityRecognizer (Prelude.Maybe Prelude.Text)
createEntityRecognizer_versionName :: (Maybe Text -> f (Maybe Text))
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_versionName = (CreateEntityRecognizer -> Maybe Text)
-> (CreateEntityRecognizer -> Maybe Text -> CreateEntityRecognizer)
-> Lens
CreateEntityRecognizer
CreateEntityRecognizer
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {Maybe Text
versionName :: Maybe Text
$sel:versionName:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe Text
versionName} -> Maybe Text
versionName) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} Maybe Text
a -> CreateEntityRecognizer
s {$sel:versionName:CreateEntityRecognizer' :: Maybe Text
versionName = Maybe Text
a} :: CreateEntityRecognizer)
createEntityRecognizer_modelKmsKeyId :: Lens.Lens' CreateEntityRecognizer (Prelude.Maybe Prelude.Text)
createEntityRecognizer_modelKmsKeyId :: (Maybe Text -> f (Maybe Text))
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_modelKmsKeyId = (CreateEntityRecognizer -> Maybe Text)
-> (CreateEntityRecognizer -> Maybe Text -> CreateEntityRecognizer)
-> Lens
CreateEntityRecognizer
CreateEntityRecognizer
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {Maybe Text
modelKmsKeyId :: Maybe Text
$sel:modelKmsKeyId:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe Text
modelKmsKeyId} -> Maybe Text
modelKmsKeyId) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} Maybe Text
a -> CreateEntityRecognizer
s {$sel:modelKmsKeyId:CreateEntityRecognizer' :: Maybe Text
modelKmsKeyId = Maybe Text
a} :: CreateEntityRecognizer)
createEntityRecognizer_vpcConfig :: Lens.Lens' CreateEntityRecognizer (Prelude.Maybe VpcConfig)
createEntityRecognizer_vpcConfig :: (Maybe VpcConfig -> f (Maybe VpcConfig))
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_vpcConfig = (CreateEntityRecognizer -> Maybe VpcConfig)
-> (CreateEntityRecognizer
-> Maybe VpcConfig -> CreateEntityRecognizer)
-> Lens
CreateEntityRecognizer
CreateEntityRecognizer
(Maybe VpcConfig)
(Maybe VpcConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {Maybe VpcConfig
vpcConfig :: Maybe VpcConfig
$sel:vpcConfig:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe VpcConfig
vpcConfig} -> Maybe VpcConfig
vpcConfig) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} Maybe VpcConfig
a -> CreateEntityRecognizer
s {$sel:vpcConfig:CreateEntityRecognizer' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
a} :: CreateEntityRecognizer)
createEntityRecognizer_volumeKmsKeyId :: Lens.Lens' CreateEntityRecognizer (Prelude.Maybe Prelude.Text)
createEntityRecognizer_volumeKmsKeyId :: (Maybe Text -> f (Maybe Text))
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_volumeKmsKeyId = (CreateEntityRecognizer -> Maybe Text)
-> (CreateEntityRecognizer -> Maybe Text -> CreateEntityRecognizer)
-> Lens
CreateEntityRecognizer
CreateEntityRecognizer
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {Maybe Text
volumeKmsKeyId :: Maybe Text
$sel:volumeKmsKeyId:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe Text
volumeKmsKeyId} -> Maybe Text
volumeKmsKeyId) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} Maybe Text
a -> CreateEntityRecognizer
s {$sel:volumeKmsKeyId:CreateEntityRecognizer' :: Maybe Text
volumeKmsKeyId = Maybe Text
a} :: CreateEntityRecognizer)
createEntityRecognizer_clientRequestToken :: Lens.Lens' CreateEntityRecognizer (Prelude.Maybe Prelude.Text)
createEntityRecognizer_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_clientRequestToken = (CreateEntityRecognizer -> Maybe Text)
-> (CreateEntityRecognizer -> Maybe Text -> CreateEntityRecognizer)
-> Lens
CreateEntityRecognizer
CreateEntityRecognizer
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} Maybe Text
a -> CreateEntityRecognizer
s {$sel:clientRequestToken:CreateEntityRecognizer' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateEntityRecognizer)
createEntityRecognizer_tags :: Lens.Lens' CreateEntityRecognizer (Prelude.Maybe [Tag])
createEntityRecognizer_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_tags = (CreateEntityRecognizer -> Maybe [Tag])
-> (CreateEntityRecognizer
-> Maybe [Tag] -> CreateEntityRecognizer)
-> Lens
CreateEntityRecognizer
CreateEntityRecognizer
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} Maybe [Tag]
a -> CreateEntityRecognizer
s {$sel:tags:CreateEntityRecognizer' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateEntityRecognizer) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateEntityRecognizer -> f CreateEntityRecognizer)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateEntityRecognizer
-> f CreateEntityRecognizer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createEntityRecognizer_recognizerName :: Lens.Lens' CreateEntityRecognizer Prelude.Text
createEntityRecognizer_recognizerName :: (Text -> f Text)
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_recognizerName = (CreateEntityRecognizer -> Text)
-> (CreateEntityRecognizer -> Text -> CreateEntityRecognizer)
-> Lens CreateEntityRecognizer CreateEntityRecognizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {Text
recognizerName :: Text
$sel:recognizerName:CreateEntityRecognizer' :: CreateEntityRecognizer -> Text
recognizerName} -> Text
recognizerName) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} Text
a -> CreateEntityRecognizer
s {$sel:recognizerName:CreateEntityRecognizer' :: Text
recognizerName = Text
a} :: CreateEntityRecognizer)
createEntityRecognizer_dataAccessRoleArn :: Lens.Lens' CreateEntityRecognizer Prelude.Text
createEntityRecognizer_dataAccessRoleArn :: (Text -> f Text)
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_dataAccessRoleArn = (CreateEntityRecognizer -> Text)
-> (CreateEntityRecognizer -> Text -> CreateEntityRecognizer)
-> Lens CreateEntityRecognizer CreateEntityRecognizer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {Text
dataAccessRoleArn :: Text
$sel:dataAccessRoleArn:CreateEntityRecognizer' :: CreateEntityRecognizer -> Text
dataAccessRoleArn} -> Text
dataAccessRoleArn) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} Text
a -> CreateEntityRecognizer
s {$sel:dataAccessRoleArn:CreateEntityRecognizer' :: Text
dataAccessRoleArn = Text
a} :: CreateEntityRecognizer)
createEntityRecognizer_inputDataConfig :: Lens.Lens' CreateEntityRecognizer EntityRecognizerInputDataConfig
createEntityRecognizer_inputDataConfig :: (EntityRecognizerInputDataConfig
-> f EntityRecognizerInputDataConfig)
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_inputDataConfig = (CreateEntityRecognizer -> EntityRecognizerInputDataConfig)
-> (CreateEntityRecognizer
-> EntityRecognizerInputDataConfig -> CreateEntityRecognizer)
-> Lens
CreateEntityRecognizer
CreateEntityRecognizer
EntityRecognizerInputDataConfig
EntityRecognizerInputDataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {EntityRecognizerInputDataConfig
inputDataConfig :: EntityRecognizerInputDataConfig
$sel:inputDataConfig:CreateEntityRecognizer' :: CreateEntityRecognizer -> EntityRecognizerInputDataConfig
inputDataConfig} -> EntityRecognizerInputDataConfig
inputDataConfig) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} EntityRecognizerInputDataConfig
a -> CreateEntityRecognizer
s {$sel:inputDataConfig:CreateEntityRecognizer' :: EntityRecognizerInputDataConfig
inputDataConfig = EntityRecognizerInputDataConfig
a} :: CreateEntityRecognizer)
createEntityRecognizer_languageCode :: Lens.Lens' CreateEntityRecognizer LanguageCode
createEntityRecognizer_languageCode :: (LanguageCode -> f LanguageCode)
-> CreateEntityRecognizer -> f CreateEntityRecognizer
createEntityRecognizer_languageCode = (CreateEntityRecognizer -> LanguageCode)
-> (CreateEntityRecognizer
-> LanguageCode -> CreateEntityRecognizer)
-> Lens
CreateEntityRecognizer
CreateEntityRecognizer
LanguageCode
LanguageCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizer' {LanguageCode
languageCode :: LanguageCode
$sel:languageCode:CreateEntityRecognizer' :: CreateEntityRecognizer -> LanguageCode
languageCode} -> LanguageCode
languageCode) (\s :: CreateEntityRecognizer
s@CreateEntityRecognizer' {} LanguageCode
a -> CreateEntityRecognizer
s {$sel:languageCode:CreateEntityRecognizer' :: LanguageCode
languageCode = LanguageCode
a} :: CreateEntityRecognizer)
instance Core.AWSRequest CreateEntityRecognizer where
type
AWSResponse CreateEntityRecognizer =
CreateEntityRecognizerResponse
request :: CreateEntityRecognizer -> Request CreateEntityRecognizer
request = Service -> CreateEntityRecognizer -> Request CreateEntityRecognizer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateEntityRecognizer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateEntityRecognizer)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateEntityRecognizer))
-> Logger
-> Service
-> Proxy CreateEntityRecognizer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateEntityRecognizer)))
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 Text -> Int -> CreateEntityRecognizerResponse
CreateEntityRecognizerResponse'
(Maybe Text -> Int -> CreateEntityRecognizerResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateEntityRecognizerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EntityRecognizerArn")
Either String (Int -> CreateEntityRecognizerResponse)
-> Either String Int
-> Either String CreateEntityRecognizerResponse
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 CreateEntityRecognizer
instance Prelude.NFData CreateEntityRecognizer
instance Core.ToHeaders CreateEntityRecognizer where
toHeaders :: CreateEntityRecognizer -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateEntityRecognizer -> 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.CreateEntityRecognizer" ::
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 CreateEntityRecognizer where
toJSON :: CreateEntityRecognizer -> Value
toJSON CreateEntityRecognizer' {Maybe [Tag]
Maybe Text
Maybe VpcConfig
Text
LanguageCode
EntityRecognizerInputDataConfig
languageCode :: LanguageCode
inputDataConfig :: EntityRecognizerInputDataConfig
dataAccessRoleArn :: Text
recognizerName :: Text
tags :: Maybe [Tag]
clientRequestToken :: Maybe Text
volumeKmsKeyId :: Maybe Text
vpcConfig :: Maybe VpcConfig
modelKmsKeyId :: Maybe Text
versionName :: Maybe Text
$sel:languageCode:CreateEntityRecognizer' :: CreateEntityRecognizer -> LanguageCode
$sel:inputDataConfig:CreateEntityRecognizer' :: CreateEntityRecognizer -> EntityRecognizerInputDataConfig
$sel:dataAccessRoleArn:CreateEntityRecognizer' :: CreateEntityRecognizer -> Text
$sel:recognizerName:CreateEntityRecognizer' :: CreateEntityRecognizer -> Text
$sel:tags:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe [Tag]
$sel:clientRequestToken:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe Text
$sel:volumeKmsKeyId:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe Text
$sel:vpcConfig:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe VpcConfig
$sel:modelKmsKeyId:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe Text
$sel:versionName:CreateEntityRecognizer' :: CreateEntityRecognizer -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"VersionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
versionName,
(Text
"ModelKmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
modelKmsKeyId,
(Text
"VpcConfig" Text -> VpcConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VpcConfig -> Pair) -> Maybe VpcConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConfig
vpcConfig,
(Text
"VolumeKmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
volumeKmsKeyId,
(Text
"ClientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
(Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RecognizerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
recognizerName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DataAccessRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataAccessRoleArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"InputDataConfig" Text -> EntityRecognizerInputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EntityRecognizerInputDataConfig
inputDataConfig),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LanguageCode" Text -> LanguageCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LanguageCode
languageCode)
]
)
instance Core.ToPath CreateEntityRecognizer where
toPath :: CreateEntityRecognizer -> ByteString
toPath = ByteString -> CreateEntityRecognizer -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateEntityRecognizer where
toQuery :: CreateEntityRecognizer -> QueryString
toQuery = QueryString -> CreateEntityRecognizer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateEntityRecognizerResponse = CreateEntityRecognizerResponse'
{
CreateEntityRecognizerResponse -> Maybe Text
entityRecognizerArn :: Prelude.Maybe Prelude.Text,
CreateEntityRecognizerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateEntityRecognizerResponse
-> CreateEntityRecognizerResponse -> Bool
(CreateEntityRecognizerResponse
-> CreateEntityRecognizerResponse -> Bool)
-> (CreateEntityRecognizerResponse
-> CreateEntityRecognizerResponse -> Bool)
-> Eq CreateEntityRecognizerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEntityRecognizerResponse
-> CreateEntityRecognizerResponse -> Bool
$c/= :: CreateEntityRecognizerResponse
-> CreateEntityRecognizerResponse -> Bool
== :: CreateEntityRecognizerResponse
-> CreateEntityRecognizerResponse -> Bool
$c== :: CreateEntityRecognizerResponse
-> CreateEntityRecognizerResponse -> Bool
Prelude.Eq, ReadPrec [CreateEntityRecognizerResponse]
ReadPrec CreateEntityRecognizerResponse
Int -> ReadS CreateEntityRecognizerResponse
ReadS [CreateEntityRecognizerResponse]
(Int -> ReadS CreateEntityRecognizerResponse)
-> ReadS [CreateEntityRecognizerResponse]
-> ReadPrec CreateEntityRecognizerResponse
-> ReadPrec [CreateEntityRecognizerResponse]
-> Read CreateEntityRecognizerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEntityRecognizerResponse]
$creadListPrec :: ReadPrec [CreateEntityRecognizerResponse]
readPrec :: ReadPrec CreateEntityRecognizerResponse
$creadPrec :: ReadPrec CreateEntityRecognizerResponse
readList :: ReadS [CreateEntityRecognizerResponse]
$creadList :: ReadS [CreateEntityRecognizerResponse]
readsPrec :: Int -> ReadS CreateEntityRecognizerResponse
$creadsPrec :: Int -> ReadS CreateEntityRecognizerResponse
Prelude.Read, Int -> CreateEntityRecognizerResponse -> ShowS
[CreateEntityRecognizerResponse] -> ShowS
CreateEntityRecognizerResponse -> String
(Int -> CreateEntityRecognizerResponse -> ShowS)
-> (CreateEntityRecognizerResponse -> String)
-> ([CreateEntityRecognizerResponse] -> ShowS)
-> Show CreateEntityRecognizerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEntityRecognizerResponse] -> ShowS
$cshowList :: [CreateEntityRecognizerResponse] -> ShowS
show :: CreateEntityRecognizerResponse -> String
$cshow :: CreateEntityRecognizerResponse -> String
showsPrec :: Int -> CreateEntityRecognizerResponse -> ShowS
$cshowsPrec :: Int -> CreateEntityRecognizerResponse -> ShowS
Prelude.Show, (forall x.
CreateEntityRecognizerResponse
-> Rep CreateEntityRecognizerResponse x)
-> (forall x.
Rep CreateEntityRecognizerResponse x
-> CreateEntityRecognizerResponse)
-> Generic CreateEntityRecognizerResponse
forall x.
Rep CreateEntityRecognizerResponse x
-> CreateEntityRecognizerResponse
forall x.
CreateEntityRecognizerResponse
-> Rep CreateEntityRecognizerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEntityRecognizerResponse x
-> CreateEntityRecognizerResponse
$cfrom :: forall x.
CreateEntityRecognizerResponse
-> Rep CreateEntityRecognizerResponse x
Prelude.Generic)
newCreateEntityRecognizerResponse ::
Prelude.Int ->
CreateEntityRecognizerResponse
newCreateEntityRecognizerResponse :: Int -> CreateEntityRecognizerResponse
newCreateEntityRecognizerResponse Int
pHttpStatus_ =
CreateEntityRecognizerResponse' :: Maybe Text -> Int -> CreateEntityRecognizerResponse
CreateEntityRecognizerResponse'
{ $sel:entityRecognizerArn:CreateEntityRecognizerResponse' :: Maybe Text
entityRecognizerArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateEntityRecognizerResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createEntityRecognizerResponse_entityRecognizerArn :: Lens.Lens' CreateEntityRecognizerResponse (Prelude.Maybe Prelude.Text)
createEntityRecognizerResponse_entityRecognizerArn :: (Maybe Text -> f (Maybe Text))
-> CreateEntityRecognizerResponse
-> f CreateEntityRecognizerResponse
createEntityRecognizerResponse_entityRecognizerArn = (CreateEntityRecognizerResponse -> Maybe Text)
-> (CreateEntityRecognizerResponse
-> Maybe Text -> CreateEntityRecognizerResponse)
-> Lens
CreateEntityRecognizerResponse
CreateEntityRecognizerResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizerResponse' {Maybe Text
entityRecognizerArn :: Maybe Text
$sel:entityRecognizerArn:CreateEntityRecognizerResponse' :: CreateEntityRecognizerResponse -> Maybe Text
entityRecognizerArn} -> Maybe Text
entityRecognizerArn) (\s :: CreateEntityRecognizerResponse
s@CreateEntityRecognizerResponse' {} Maybe Text
a -> CreateEntityRecognizerResponse
s {$sel:entityRecognizerArn:CreateEntityRecognizerResponse' :: Maybe Text
entityRecognizerArn = Maybe Text
a} :: CreateEntityRecognizerResponse)
createEntityRecognizerResponse_httpStatus :: Lens.Lens' CreateEntityRecognizerResponse Prelude.Int
createEntityRecognizerResponse_httpStatus :: (Int -> f Int)
-> CreateEntityRecognizerResponse
-> f CreateEntityRecognizerResponse
createEntityRecognizerResponse_httpStatus = (CreateEntityRecognizerResponse -> Int)
-> (CreateEntityRecognizerResponse
-> Int -> CreateEntityRecognizerResponse)
-> Lens
CreateEntityRecognizerResponse
CreateEntityRecognizerResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEntityRecognizerResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateEntityRecognizerResponse' :: CreateEntityRecognizerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateEntityRecognizerResponse
s@CreateEntityRecognizerResponse' {} Int
a -> CreateEntityRecognizerResponse
s {$sel:httpStatus:CreateEntityRecognizerResponse' :: Int
httpStatus = Int
a} :: CreateEntityRecognizerResponse)
instance
Prelude.NFData
CreateEntityRecognizerResponse