{-# 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.DocumentClassifierInputDataConfig where
import Amazonka.Comprehend.Types.AugmentedManifestsListItem
import Amazonka.Comprehend.Types.DocumentClassifierDataFormat
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DocumentClassifierInputDataConfig = DocumentClassifierInputDataConfig'
{
DocumentClassifierInputDataConfig
-> Maybe [AugmentedManifestsListItem]
augmentedManifests :: Prelude.Maybe [AugmentedManifestsListItem],
DocumentClassifierInputDataConfig
-> Maybe DocumentClassifierDataFormat
dataFormat :: Prelude.Maybe DocumentClassifierDataFormat,
DocumentClassifierInputDataConfig -> Maybe Text
labelDelimiter :: Prelude.Maybe Prelude.Text,
DocumentClassifierInputDataConfig -> Maybe Text
testS3Uri :: Prelude.Maybe Prelude.Text,
DocumentClassifierInputDataConfig -> Maybe Text
s3Uri :: Prelude.Maybe Prelude.Text
}
deriving (DocumentClassifierInputDataConfig
-> DocumentClassifierInputDataConfig -> Bool
(DocumentClassifierInputDataConfig
-> DocumentClassifierInputDataConfig -> Bool)
-> (DocumentClassifierInputDataConfig
-> DocumentClassifierInputDataConfig -> Bool)
-> Eq DocumentClassifierInputDataConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentClassifierInputDataConfig
-> DocumentClassifierInputDataConfig -> Bool
$c/= :: DocumentClassifierInputDataConfig
-> DocumentClassifierInputDataConfig -> Bool
== :: DocumentClassifierInputDataConfig
-> DocumentClassifierInputDataConfig -> Bool
$c== :: DocumentClassifierInputDataConfig
-> DocumentClassifierInputDataConfig -> Bool
Prelude.Eq, ReadPrec [DocumentClassifierInputDataConfig]
ReadPrec DocumentClassifierInputDataConfig
Int -> ReadS DocumentClassifierInputDataConfig
ReadS [DocumentClassifierInputDataConfig]
(Int -> ReadS DocumentClassifierInputDataConfig)
-> ReadS [DocumentClassifierInputDataConfig]
-> ReadPrec DocumentClassifierInputDataConfig
-> ReadPrec [DocumentClassifierInputDataConfig]
-> Read DocumentClassifierInputDataConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentClassifierInputDataConfig]
$creadListPrec :: ReadPrec [DocumentClassifierInputDataConfig]
readPrec :: ReadPrec DocumentClassifierInputDataConfig
$creadPrec :: ReadPrec DocumentClassifierInputDataConfig
readList :: ReadS [DocumentClassifierInputDataConfig]
$creadList :: ReadS [DocumentClassifierInputDataConfig]
readsPrec :: Int -> ReadS DocumentClassifierInputDataConfig
$creadsPrec :: Int -> ReadS DocumentClassifierInputDataConfig
Prelude.Read, Int -> DocumentClassifierInputDataConfig -> ShowS
[DocumentClassifierInputDataConfig] -> ShowS
DocumentClassifierInputDataConfig -> String
(Int -> DocumentClassifierInputDataConfig -> ShowS)
-> (DocumentClassifierInputDataConfig -> String)
-> ([DocumentClassifierInputDataConfig] -> ShowS)
-> Show DocumentClassifierInputDataConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentClassifierInputDataConfig] -> ShowS
$cshowList :: [DocumentClassifierInputDataConfig] -> ShowS
show :: DocumentClassifierInputDataConfig -> String
$cshow :: DocumentClassifierInputDataConfig -> String
showsPrec :: Int -> DocumentClassifierInputDataConfig -> ShowS
$cshowsPrec :: Int -> DocumentClassifierInputDataConfig -> ShowS
Prelude.Show, (forall x.
DocumentClassifierInputDataConfig
-> Rep DocumentClassifierInputDataConfig x)
-> (forall x.
Rep DocumentClassifierInputDataConfig x
-> DocumentClassifierInputDataConfig)
-> Generic DocumentClassifierInputDataConfig
forall x.
Rep DocumentClassifierInputDataConfig x
-> DocumentClassifierInputDataConfig
forall x.
DocumentClassifierInputDataConfig
-> Rep DocumentClassifierInputDataConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentClassifierInputDataConfig x
-> DocumentClassifierInputDataConfig
$cfrom :: forall x.
DocumentClassifierInputDataConfig
-> Rep DocumentClassifierInputDataConfig x
Prelude.Generic)
newDocumentClassifierInputDataConfig ::
DocumentClassifierInputDataConfig
newDocumentClassifierInputDataConfig :: DocumentClassifierInputDataConfig
newDocumentClassifierInputDataConfig =
DocumentClassifierInputDataConfig' :: Maybe [AugmentedManifestsListItem]
-> Maybe DocumentClassifierDataFormat
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DocumentClassifierInputDataConfig
DocumentClassifierInputDataConfig'
{ $sel:augmentedManifests:DocumentClassifierInputDataConfig' :: Maybe [AugmentedManifestsListItem]
augmentedManifests =
Maybe [AugmentedManifestsListItem]
forall a. Maybe a
Prelude.Nothing,
$sel:dataFormat:DocumentClassifierInputDataConfig' :: Maybe DocumentClassifierDataFormat
dataFormat = Maybe DocumentClassifierDataFormat
forall a. Maybe a
Prelude.Nothing,
$sel:labelDelimiter:DocumentClassifierInputDataConfig' :: Maybe Text
labelDelimiter = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:testS3Uri:DocumentClassifierInputDataConfig' :: Maybe Text
testS3Uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Uri:DocumentClassifierInputDataConfig' :: Maybe Text
s3Uri = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
documentClassifierInputDataConfig_augmentedManifests :: Lens.Lens' DocumentClassifierInputDataConfig (Prelude.Maybe [AugmentedManifestsListItem])
documentClassifierInputDataConfig_augmentedManifests :: (Maybe [AugmentedManifestsListItem]
-> f (Maybe [AugmentedManifestsListItem]))
-> DocumentClassifierInputDataConfig
-> f DocumentClassifierInputDataConfig
documentClassifierInputDataConfig_augmentedManifests = (DocumentClassifierInputDataConfig
-> Maybe [AugmentedManifestsListItem])
-> (DocumentClassifierInputDataConfig
-> Maybe [AugmentedManifestsListItem]
-> DocumentClassifierInputDataConfig)
-> Lens
DocumentClassifierInputDataConfig
DocumentClassifierInputDataConfig
(Maybe [AugmentedManifestsListItem])
(Maybe [AugmentedManifestsListItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierInputDataConfig' {Maybe [AugmentedManifestsListItem]
augmentedManifests :: Maybe [AugmentedManifestsListItem]
$sel:augmentedManifests:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig
-> Maybe [AugmentedManifestsListItem]
augmentedManifests} -> Maybe [AugmentedManifestsListItem]
augmentedManifests) (\s :: DocumentClassifierInputDataConfig
s@DocumentClassifierInputDataConfig' {} Maybe [AugmentedManifestsListItem]
a -> DocumentClassifierInputDataConfig
s {$sel:augmentedManifests:DocumentClassifierInputDataConfig' :: Maybe [AugmentedManifestsListItem]
augmentedManifests = Maybe [AugmentedManifestsListItem]
a} :: DocumentClassifierInputDataConfig) ((Maybe [AugmentedManifestsListItem]
-> f (Maybe [AugmentedManifestsListItem]))
-> DocumentClassifierInputDataConfig
-> f DocumentClassifierInputDataConfig)
-> ((Maybe [AugmentedManifestsListItem]
-> f (Maybe [AugmentedManifestsListItem]))
-> Maybe [AugmentedManifestsListItem]
-> f (Maybe [AugmentedManifestsListItem]))
-> (Maybe [AugmentedManifestsListItem]
-> f (Maybe [AugmentedManifestsListItem]))
-> DocumentClassifierInputDataConfig
-> f DocumentClassifierInputDataConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AugmentedManifestsListItem]
[AugmentedManifestsListItem]
[AugmentedManifestsListItem]
[AugmentedManifestsListItem]
-> Iso
(Maybe [AugmentedManifestsListItem])
(Maybe [AugmentedManifestsListItem])
(Maybe [AugmentedManifestsListItem])
(Maybe [AugmentedManifestsListItem])
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
[AugmentedManifestsListItem]
[AugmentedManifestsListItem]
[AugmentedManifestsListItem]
[AugmentedManifestsListItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
documentClassifierInputDataConfig_dataFormat :: Lens.Lens' DocumentClassifierInputDataConfig (Prelude.Maybe DocumentClassifierDataFormat)
documentClassifierInputDataConfig_dataFormat :: (Maybe DocumentClassifierDataFormat
-> f (Maybe DocumentClassifierDataFormat))
-> DocumentClassifierInputDataConfig
-> f DocumentClassifierInputDataConfig
documentClassifierInputDataConfig_dataFormat = (DocumentClassifierInputDataConfig
-> Maybe DocumentClassifierDataFormat)
-> (DocumentClassifierInputDataConfig
-> Maybe DocumentClassifierDataFormat
-> DocumentClassifierInputDataConfig)
-> Lens
DocumentClassifierInputDataConfig
DocumentClassifierInputDataConfig
(Maybe DocumentClassifierDataFormat)
(Maybe DocumentClassifierDataFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierInputDataConfig' {Maybe DocumentClassifierDataFormat
dataFormat :: Maybe DocumentClassifierDataFormat
$sel:dataFormat:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig
-> Maybe DocumentClassifierDataFormat
dataFormat} -> Maybe DocumentClassifierDataFormat
dataFormat) (\s :: DocumentClassifierInputDataConfig
s@DocumentClassifierInputDataConfig' {} Maybe DocumentClassifierDataFormat
a -> DocumentClassifierInputDataConfig
s {$sel:dataFormat:DocumentClassifierInputDataConfig' :: Maybe DocumentClassifierDataFormat
dataFormat = Maybe DocumentClassifierDataFormat
a} :: DocumentClassifierInputDataConfig)
documentClassifierInputDataConfig_labelDelimiter :: Lens.Lens' DocumentClassifierInputDataConfig (Prelude.Maybe Prelude.Text)
documentClassifierInputDataConfig_labelDelimiter :: (Maybe Text -> f (Maybe Text))
-> DocumentClassifierInputDataConfig
-> f DocumentClassifierInputDataConfig
documentClassifierInputDataConfig_labelDelimiter = (DocumentClassifierInputDataConfig -> Maybe Text)
-> (DocumentClassifierInputDataConfig
-> Maybe Text -> DocumentClassifierInputDataConfig)
-> Lens
DocumentClassifierInputDataConfig
DocumentClassifierInputDataConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierInputDataConfig' {Maybe Text
labelDelimiter :: Maybe Text
$sel:labelDelimiter:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig -> Maybe Text
labelDelimiter} -> Maybe Text
labelDelimiter) (\s :: DocumentClassifierInputDataConfig
s@DocumentClassifierInputDataConfig' {} Maybe Text
a -> DocumentClassifierInputDataConfig
s {$sel:labelDelimiter:DocumentClassifierInputDataConfig' :: Maybe Text
labelDelimiter = Maybe Text
a} :: DocumentClassifierInputDataConfig)
documentClassifierInputDataConfig_testS3Uri :: Lens.Lens' DocumentClassifierInputDataConfig (Prelude.Maybe Prelude.Text)
documentClassifierInputDataConfig_testS3Uri :: (Maybe Text -> f (Maybe Text))
-> DocumentClassifierInputDataConfig
-> f DocumentClassifierInputDataConfig
documentClassifierInputDataConfig_testS3Uri = (DocumentClassifierInputDataConfig -> Maybe Text)
-> (DocumentClassifierInputDataConfig
-> Maybe Text -> DocumentClassifierInputDataConfig)
-> Lens
DocumentClassifierInputDataConfig
DocumentClassifierInputDataConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierInputDataConfig' {Maybe Text
testS3Uri :: Maybe Text
$sel:testS3Uri:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig -> Maybe Text
testS3Uri} -> Maybe Text
testS3Uri) (\s :: DocumentClassifierInputDataConfig
s@DocumentClassifierInputDataConfig' {} Maybe Text
a -> DocumentClassifierInputDataConfig
s {$sel:testS3Uri:DocumentClassifierInputDataConfig' :: Maybe Text
testS3Uri = Maybe Text
a} :: DocumentClassifierInputDataConfig)
documentClassifierInputDataConfig_s3Uri :: Lens.Lens' DocumentClassifierInputDataConfig (Prelude.Maybe Prelude.Text)
documentClassifierInputDataConfig_s3Uri :: (Maybe Text -> f (Maybe Text))
-> DocumentClassifierInputDataConfig
-> f DocumentClassifierInputDataConfig
documentClassifierInputDataConfig_s3Uri = (DocumentClassifierInputDataConfig -> Maybe Text)
-> (DocumentClassifierInputDataConfig
-> Maybe Text -> DocumentClassifierInputDataConfig)
-> Lens
DocumentClassifierInputDataConfig
DocumentClassifierInputDataConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentClassifierInputDataConfig' {Maybe Text
s3Uri :: Maybe Text
$sel:s3Uri:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig -> Maybe Text
s3Uri} -> Maybe Text
s3Uri) (\s :: DocumentClassifierInputDataConfig
s@DocumentClassifierInputDataConfig' {} Maybe Text
a -> DocumentClassifierInputDataConfig
s {$sel:s3Uri:DocumentClassifierInputDataConfig' :: Maybe Text
s3Uri = Maybe Text
a} :: DocumentClassifierInputDataConfig)
instance
Core.FromJSON
DocumentClassifierInputDataConfig
where
parseJSON :: Value -> Parser DocumentClassifierInputDataConfig
parseJSON =
String
-> (Object -> Parser DocumentClassifierInputDataConfig)
-> Value
-> Parser DocumentClassifierInputDataConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DocumentClassifierInputDataConfig"
( \Object
x ->
Maybe [AugmentedManifestsListItem]
-> Maybe DocumentClassifierDataFormat
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DocumentClassifierInputDataConfig
DocumentClassifierInputDataConfig'
(Maybe [AugmentedManifestsListItem]
-> Maybe DocumentClassifierDataFormat
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DocumentClassifierInputDataConfig)
-> Parser (Maybe [AugmentedManifestsListItem])
-> Parser
(Maybe DocumentClassifierDataFormat
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DocumentClassifierInputDataConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [AugmentedManifestsListItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AugmentedManifests"
Parser (Maybe (Maybe [AugmentedManifestsListItem]))
-> Maybe [AugmentedManifestsListItem]
-> Parser (Maybe [AugmentedManifestsListItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AugmentedManifestsListItem]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe DocumentClassifierDataFormat
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DocumentClassifierInputDataConfig)
-> Parser (Maybe DocumentClassifierDataFormat)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> DocumentClassifierInputDataConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DocumentClassifierDataFormat)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DataFormat")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> DocumentClassifierInputDataConfig)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> DocumentClassifierInputDataConfig)
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
"LabelDelimiter")
Parser
(Maybe Text -> Maybe Text -> DocumentClassifierInputDataConfig)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> DocumentClassifierInputDataConfig)
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 (Maybe Text -> DocumentClassifierInputDataConfig)
-> Parser (Maybe Text) -> Parser DocumentClassifierInputDataConfig
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
"S3Uri")
)
instance
Prelude.Hashable
DocumentClassifierInputDataConfig
instance
Prelude.NFData
DocumentClassifierInputDataConfig
instance
Core.ToJSON
DocumentClassifierInputDataConfig
where
toJSON :: DocumentClassifierInputDataConfig -> Value
toJSON DocumentClassifierInputDataConfig' {Maybe [AugmentedManifestsListItem]
Maybe Text
Maybe DocumentClassifierDataFormat
s3Uri :: Maybe Text
testS3Uri :: Maybe Text
labelDelimiter :: Maybe Text
dataFormat :: Maybe DocumentClassifierDataFormat
augmentedManifests :: Maybe [AugmentedManifestsListItem]
$sel:s3Uri:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig -> Maybe Text
$sel:testS3Uri:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig -> Maybe Text
$sel:labelDelimiter:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig -> Maybe Text
$sel:dataFormat:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig
-> Maybe DocumentClassifierDataFormat
$sel:augmentedManifests:DocumentClassifierInputDataConfig' :: DocumentClassifierInputDataConfig
-> Maybe [AugmentedManifestsListItem]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AugmentedManifests" Text -> [AugmentedManifestsListItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([AugmentedManifestsListItem] -> Pair)
-> Maybe [AugmentedManifestsListItem] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AugmentedManifestsListItem]
augmentedManifests,
(Text
"DataFormat" Text -> DocumentClassifierDataFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DocumentClassifierDataFormat -> Pair)
-> Maybe DocumentClassifierDataFormat -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DocumentClassifierDataFormat
dataFormat,
(Text
"LabelDelimiter" 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
labelDelimiter,
(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,
(Text
"S3Uri" 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
s3Uri
]
)