{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Comprehend.Types.EntityRecognizerDocuments where
import Amazonka.Comprehend.Types.InputFormat
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EntityRecognizerDocuments = EntityRecognizerDocuments'
{
EntityRecognizerDocuments -> Maybe InputFormat
inputFormat :: Prelude.Maybe InputFormat,
EntityRecognizerDocuments -> Maybe Text
testS3Uri :: Prelude.Maybe Prelude.Text,
EntityRecognizerDocuments -> Text
s3Uri :: Prelude.Text
}
deriving (EntityRecognizerDocuments -> EntityRecognizerDocuments -> Bool
(EntityRecognizerDocuments -> EntityRecognizerDocuments -> Bool)
-> (EntityRecognizerDocuments -> EntityRecognizerDocuments -> Bool)
-> Eq EntityRecognizerDocuments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityRecognizerDocuments -> EntityRecognizerDocuments -> Bool
$c/= :: EntityRecognizerDocuments -> EntityRecognizerDocuments -> Bool
== :: EntityRecognizerDocuments -> EntityRecognizerDocuments -> Bool
$c== :: EntityRecognizerDocuments -> EntityRecognizerDocuments -> Bool
Prelude.Eq, ReadPrec [EntityRecognizerDocuments]
ReadPrec EntityRecognizerDocuments
Int -> ReadS EntityRecognizerDocuments
ReadS [EntityRecognizerDocuments]
(Int -> ReadS EntityRecognizerDocuments)
-> ReadS [EntityRecognizerDocuments]
-> ReadPrec EntityRecognizerDocuments
-> ReadPrec [EntityRecognizerDocuments]
-> Read EntityRecognizerDocuments
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntityRecognizerDocuments]
$creadListPrec :: ReadPrec [EntityRecognizerDocuments]
readPrec :: ReadPrec EntityRecognizerDocuments
$creadPrec :: ReadPrec EntityRecognizerDocuments
readList :: ReadS [EntityRecognizerDocuments]
$creadList :: ReadS [EntityRecognizerDocuments]
readsPrec :: Int -> ReadS EntityRecognizerDocuments
$creadsPrec :: Int -> ReadS EntityRecognizerDocuments
Prelude.Read, Int -> EntityRecognizerDocuments -> ShowS
[EntityRecognizerDocuments] -> ShowS
EntityRecognizerDocuments -> String
(Int -> EntityRecognizerDocuments -> ShowS)
-> (EntityRecognizerDocuments -> String)
-> ([EntityRecognizerDocuments] -> ShowS)
-> Show EntityRecognizerDocuments
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityRecognizerDocuments] -> ShowS
$cshowList :: [EntityRecognizerDocuments] -> ShowS
show :: EntityRecognizerDocuments -> String
$cshow :: EntityRecognizerDocuments -> String
showsPrec :: Int -> EntityRecognizerDocuments -> ShowS
$cshowsPrec :: Int -> EntityRecognizerDocuments -> ShowS
Prelude.Show, (forall x.
EntityRecognizerDocuments -> Rep EntityRecognizerDocuments x)
-> (forall x.
Rep EntityRecognizerDocuments x -> EntityRecognizerDocuments)
-> Generic EntityRecognizerDocuments
forall x.
Rep EntityRecognizerDocuments x -> EntityRecognizerDocuments
forall x.
EntityRecognizerDocuments -> Rep EntityRecognizerDocuments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EntityRecognizerDocuments x -> EntityRecognizerDocuments
$cfrom :: forall x.
EntityRecognizerDocuments -> Rep EntityRecognizerDocuments x
Prelude.Generic)
newEntityRecognizerDocuments ::
Prelude.Text ->
EntityRecognizerDocuments
newEntityRecognizerDocuments :: Text -> EntityRecognizerDocuments
newEntityRecognizerDocuments Text
pS3Uri_ =
EntityRecognizerDocuments' :: Maybe InputFormat
-> Maybe Text -> Text -> EntityRecognizerDocuments
EntityRecognizerDocuments'
{ $sel:inputFormat:EntityRecognizerDocuments' :: Maybe InputFormat
inputFormat =
Maybe InputFormat
forall a. Maybe a
Prelude.Nothing,
$sel:testS3Uri:EntityRecognizerDocuments' :: Maybe Text
testS3Uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Uri:EntityRecognizerDocuments' :: Text
s3Uri = Text
pS3Uri_
}
entityRecognizerDocuments_inputFormat :: Lens.Lens' EntityRecognizerDocuments (Prelude.Maybe InputFormat)
entityRecognizerDocuments_inputFormat :: (Maybe InputFormat -> f (Maybe InputFormat))
-> EntityRecognizerDocuments -> f EntityRecognizerDocuments
entityRecognizerDocuments_inputFormat = (EntityRecognizerDocuments -> Maybe InputFormat)
-> (EntityRecognizerDocuments
-> Maybe InputFormat -> EntityRecognizerDocuments)
-> Lens
EntityRecognizerDocuments
EntityRecognizerDocuments
(Maybe InputFormat)
(Maybe InputFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerDocuments' {Maybe InputFormat
inputFormat :: Maybe InputFormat
$sel:inputFormat:EntityRecognizerDocuments' :: EntityRecognizerDocuments -> Maybe InputFormat
inputFormat} -> Maybe InputFormat
inputFormat) (\s :: EntityRecognizerDocuments
s@EntityRecognizerDocuments' {} Maybe InputFormat
a -> EntityRecognizerDocuments
s {$sel:inputFormat:EntityRecognizerDocuments' :: Maybe InputFormat
inputFormat = Maybe InputFormat
a} :: EntityRecognizerDocuments)
entityRecognizerDocuments_testS3Uri :: Lens.Lens' EntityRecognizerDocuments (Prelude.Maybe Prelude.Text)
entityRecognizerDocuments_testS3Uri :: (Maybe Text -> f (Maybe Text))
-> EntityRecognizerDocuments -> f EntityRecognizerDocuments
entityRecognizerDocuments_testS3Uri = (EntityRecognizerDocuments -> Maybe Text)
-> (EntityRecognizerDocuments
-> Maybe Text -> EntityRecognizerDocuments)
-> Lens
EntityRecognizerDocuments
EntityRecognizerDocuments
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerDocuments' {Maybe Text
testS3Uri :: Maybe Text
$sel:testS3Uri:EntityRecognizerDocuments' :: EntityRecognizerDocuments -> Maybe Text
testS3Uri} -> Maybe Text
testS3Uri) (\s :: EntityRecognizerDocuments
s@EntityRecognizerDocuments' {} Maybe Text
a -> EntityRecognizerDocuments
s {$sel:testS3Uri:EntityRecognizerDocuments' :: Maybe Text
testS3Uri = Maybe Text
a} :: EntityRecognizerDocuments)
entityRecognizerDocuments_s3Uri :: Lens.Lens' EntityRecognizerDocuments Prelude.Text
entityRecognizerDocuments_s3Uri :: (Text -> f Text)
-> EntityRecognizerDocuments -> f EntityRecognizerDocuments
entityRecognizerDocuments_s3Uri = (EntityRecognizerDocuments -> Text)
-> (EntityRecognizerDocuments -> Text -> EntityRecognizerDocuments)
-> Lens
EntityRecognizerDocuments EntityRecognizerDocuments Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerDocuments' {Text
s3Uri :: Text
$sel:s3Uri:EntityRecognizerDocuments' :: EntityRecognizerDocuments -> Text
s3Uri} -> Text
s3Uri) (\s :: EntityRecognizerDocuments
s@EntityRecognizerDocuments' {} Text
a -> EntityRecognizerDocuments
s {$sel:s3Uri:EntityRecognizerDocuments' :: Text
s3Uri = Text
a} :: EntityRecognizerDocuments)
instance Core.FromJSON EntityRecognizerDocuments where
parseJSON :: Value -> Parser EntityRecognizerDocuments
parseJSON =
String
-> (Object -> Parser EntityRecognizerDocuments)
-> Value
-> Parser EntityRecognizerDocuments
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EntityRecognizerDocuments"
( \Object
x ->
Maybe InputFormat
-> Maybe Text -> Text -> EntityRecognizerDocuments
EntityRecognizerDocuments'
(Maybe InputFormat
-> Maybe Text -> Text -> EntityRecognizerDocuments)
-> Parser (Maybe InputFormat)
-> Parser (Maybe Text -> Text -> EntityRecognizerDocuments)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InputFormat)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InputFormat")
Parser (Maybe Text -> Text -> EntityRecognizerDocuments)
-> Parser (Maybe Text)
-> Parser (Text -> EntityRecognizerDocuments)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TestS3Uri")
Parser (Text -> EntityRecognizerDocuments)
-> Parser Text -> Parser EntityRecognizerDocuments
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3Uri")
)
instance Prelude.Hashable EntityRecognizerDocuments
instance Prelude.NFData EntityRecognizerDocuments
instance Core.ToJSON EntityRecognizerDocuments where
toJSON :: EntityRecognizerDocuments -> Value
toJSON EntityRecognizerDocuments' {Maybe Text
Maybe InputFormat
Text
s3Uri :: Text
testS3Uri :: Maybe Text
inputFormat :: Maybe InputFormat
$sel:s3Uri:EntityRecognizerDocuments' :: EntityRecognizerDocuments -> Text
$sel:testS3Uri:EntityRecognizerDocuments' :: EntityRecognizerDocuments -> Maybe Text
$sel:inputFormat:EntityRecognizerDocuments' :: EntityRecognizerDocuments -> Maybe InputFormat
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InputFormat" Text -> InputFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (InputFormat -> Pair) -> Maybe InputFormat -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputFormat
inputFormat,
(Text
"TestS3Uri" 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
testS3Uri,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"S3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3Uri)
]
)