{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Comprehend.Types.EntityRecognizerInputDataConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Comprehend.Types.EntityRecognizerInputDataConfig where

import Amazonka.Comprehend.Types.AugmentedManifestsListItem
import Amazonka.Comprehend.Types.EntityRecognizerAnnotations
import Amazonka.Comprehend.Types.EntityRecognizerDataFormat
import Amazonka.Comprehend.Types.EntityRecognizerDocuments
import Amazonka.Comprehend.Types.EntityRecognizerEntityList
import Amazonka.Comprehend.Types.EntityTypesListItem
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies the format and location of the input data.
--
-- /See:/ 'newEntityRecognizerInputDataConfig' smart constructor.
data EntityRecognizerInputDataConfig = EntityRecognizerInputDataConfig'
  { -- | A list of augmented manifest files that provide training data for your
    -- custom model. An augmented manifest file is a labeled dataset that is
    -- produced by Amazon SageMaker Ground Truth.
    --
    -- This parameter is required if you set @DataFormat@ to
    -- @AUGMENTED_MANIFEST@.
    EntityRecognizerInputDataConfig
-> Maybe [AugmentedManifestsListItem]
augmentedManifests :: Prelude.Maybe [AugmentedManifestsListItem],
    -- | The S3 location of the CSV file that annotates your training documents.
    EntityRecognizerInputDataConfig
-> Maybe EntityRecognizerAnnotations
annotations :: Prelude.Maybe EntityRecognizerAnnotations,
    -- | The format of your training data:
    --
    -- -   @COMPREHEND_CSV@: A CSV file that supplements your training
    --     documents. The CSV file contains information about the custom
    --     entities that your trained model will detect. The required format of
    --     the file depends on whether you are providing annotations or an
    --     entity list.
    --
    --     If you use this value, you must provide your CSV file by using
    --     either the @Annotations@ or @EntityList@ parameters. You must
    --     provide your training documents by using the @Documents@ parameter.
    --
    -- -   @AUGMENTED_MANIFEST@: A labeled dataset that is produced by Amazon
    --     SageMaker Ground Truth. This file is in JSON lines format. Each line
    --     is a complete JSON object that contains a training document and its
    --     labels. Each label annotates a named entity in the training
    --     document.
    --
    --     If you use this value, you must provide the @AugmentedManifests@
    --     parameter in your request.
    --
    -- If you don\'t specify a value, Amazon Comprehend uses @COMPREHEND_CSV@
    -- as the default.
    EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDataFormat
dataFormat :: Prelude.Maybe EntityRecognizerDataFormat,
    -- | The S3 location of the folder that contains the training documents for
    -- your custom entity recognizer.
    --
    -- This parameter is required if you set @DataFormat@ to @COMPREHEND_CSV@.
    EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDocuments
documents :: Prelude.Maybe EntityRecognizerDocuments,
    -- | The S3 location of the CSV file that has the entity list for your custom
    -- entity recognizer.
    EntityRecognizerInputDataConfig -> Maybe EntityRecognizerEntityList
entityList :: Prelude.Maybe EntityRecognizerEntityList,
    -- | The entity types in the labeled training data that Amazon Comprehend
    -- uses to train the custom entity recognizer. Any entity types that you
    -- don\'t specify are ignored.
    --
    -- A maximum of 25 entity types can be used at one time to train an entity
    -- recognizer. Entity types must not contain the following invalid
    -- characters: \\n (line break), \\\\n (escaped line break), \\r (carriage
    -- return), \\\\r (escaped carriage return), \\t (tab), \\\\t (escaped
    -- tab), space, and , (comma).
    EntityRecognizerInputDataConfig -> [EntityTypesListItem]
entityTypes :: [EntityTypesListItem]
  }
  deriving (EntityRecognizerInputDataConfig
-> EntityRecognizerInputDataConfig -> Bool
(EntityRecognizerInputDataConfig
 -> EntityRecognizerInputDataConfig -> Bool)
-> (EntityRecognizerInputDataConfig
    -> EntityRecognizerInputDataConfig -> Bool)
-> Eq EntityRecognizerInputDataConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityRecognizerInputDataConfig
-> EntityRecognizerInputDataConfig -> Bool
$c/= :: EntityRecognizerInputDataConfig
-> EntityRecognizerInputDataConfig -> Bool
== :: EntityRecognizerInputDataConfig
-> EntityRecognizerInputDataConfig -> Bool
$c== :: EntityRecognizerInputDataConfig
-> EntityRecognizerInputDataConfig -> Bool
Prelude.Eq, ReadPrec [EntityRecognizerInputDataConfig]
ReadPrec EntityRecognizerInputDataConfig
Int -> ReadS EntityRecognizerInputDataConfig
ReadS [EntityRecognizerInputDataConfig]
(Int -> ReadS EntityRecognizerInputDataConfig)
-> ReadS [EntityRecognizerInputDataConfig]
-> ReadPrec EntityRecognizerInputDataConfig
-> ReadPrec [EntityRecognizerInputDataConfig]
-> Read EntityRecognizerInputDataConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntityRecognizerInputDataConfig]
$creadListPrec :: ReadPrec [EntityRecognizerInputDataConfig]
readPrec :: ReadPrec EntityRecognizerInputDataConfig
$creadPrec :: ReadPrec EntityRecognizerInputDataConfig
readList :: ReadS [EntityRecognizerInputDataConfig]
$creadList :: ReadS [EntityRecognizerInputDataConfig]
readsPrec :: Int -> ReadS EntityRecognizerInputDataConfig
$creadsPrec :: Int -> ReadS EntityRecognizerInputDataConfig
Prelude.Read, Int -> EntityRecognizerInputDataConfig -> ShowS
[EntityRecognizerInputDataConfig] -> ShowS
EntityRecognizerInputDataConfig -> String
(Int -> EntityRecognizerInputDataConfig -> ShowS)
-> (EntityRecognizerInputDataConfig -> String)
-> ([EntityRecognizerInputDataConfig] -> ShowS)
-> Show EntityRecognizerInputDataConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityRecognizerInputDataConfig] -> ShowS
$cshowList :: [EntityRecognizerInputDataConfig] -> ShowS
show :: EntityRecognizerInputDataConfig -> String
$cshow :: EntityRecognizerInputDataConfig -> String
showsPrec :: Int -> EntityRecognizerInputDataConfig -> ShowS
$cshowsPrec :: Int -> EntityRecognizerInputDataConfig -> ShowS
Prelude.Show, (forall x.
 EntityRecognizerInputDataConfig
 -> Rep EntityRecognizerInputDataConfig x)
-> (forall x.
    Rep EntityRecognizerInputDataConfig x
    -> EntityRecognizerInputDataConfig)
-> Generic EntityRecognizerInputDataConfig
forall x.
Rep EntityRecognizerInputDataConfig x
-> EntityRecognizerInputDataConfig
forall x.
EntityRecognizerInputDataConfig
-> Rep EntityRecognizerInputDataConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EntityRecognizerInputDataConfig x
-> EntityRecognizerInputDataConfig
$cfrom :: forall x.
EntityRecognizerInputDataConfig
-> Rep EntityRecognizerInputDataConfig x
Prelude.Generic)

-- |
-- Create a value of 'EntityRecognizerInputDataConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'augmentedManifests', 'entityRecognizerInputDataConfig_augmentedManifests' - A list of augmented manifest files that provide training data for your
-- custom model. An augmented manifest file is a labeled dataset that is
-- produced by Amazon SageMaker Ground Truth.
--
-- This parameter is required if you set @DataFormat@ to
-- @AUGMENTED_MANIFEST@.
--
-- 'annotations', 'entityRecognizerInputDataConfig_annotations' - The S3 location of the CSV file that annotates your training documents.
--
-- 'dataFormat', 'entityRecognizerInputDataConfig_dataFormat' - The format of your training data:
--
-- -   @COMPREHEND_CSV@: A CSV file that supplements your training
--     documents. The CSV file contains information about the custom
--     entities that your trained model will detect. The required format of
--     the file depends on whether you are providing annotations or an
--     entity list.
--
--     If you use this value, you must provide your CSV file by using
--     either the @Annotations@ or @EntityList@ parameters. You must
--     provide your training documents by using the @Documents@ parameter.
--
-- -   @AUGMENTED_MANIFEST@: A labeled dataset that is produced by Amazon
--     SageMaker Ground Truth. This file is in JSON lines format. Each line
--     is a complete JSON object that contains a training document and its
--     labels. Each label annotates a named entity in the training
--     document.
--
--     If you use this value, you must provide the @AugmentedManifests@
--     parameter in your request.
--
-- If you don\'t specify a value, Amazon Comprehend uses @COMPREHEND_CSV@
-- as the default.
--
-- 'documents', 'entityRecognizerInputDataConfig_documents' - The S3 location of the folder that contains the training documents for
-- your custom entity recognizer.
--
-- This parameter is required if you set @DataFormat@ to @COMPREHEND_CSV@.
--
-- 'entityList', 'entityRecognizerInputDataConfig_entityList' - The S3 location of the CSV file that has the entity list for your custom
-- entity recognizer.
--
-- 'entityTypes', 'entityRecognizerInputDataConfig_entityTypes' - The entity types in the labeled training data that Amazon Comprehend
-- uses to train the custom entity recognizer. Any entity types that you
-- don\'t specify are ignored.
--
-- A maximum of 25 entity types can be used at one time to train an entity
-- recognizer. Entity types must not contain the following invalid
-- characters: \\n (line break), \\\\n (escaped line break), \\r (carriage
-- return), \\\\r (escaped carriage return), \\t (tab), \\\\t (escaped
-- tab), space, and , (comma).
newEntityRecognizerInputDataConfig ::
  EntityRecognizerInputDataConfig
newEntityRecognizerInputDataConfig :: EntityRecognizerInputDataConfig
newEntityRecognizerInputDataConfig =
  EntityRecognizerInputDataConfig' :: Maybe [AugmentedManifestsListItem]
-> Maybe EntityRecognizerAnnotations
-> Maybe EntityRecognizerDataFormat
-> Maybe EntityRecognizerDocuments
-> Maybe EntityRecognizerEntityList
-> [EntityTypesListItem]
-> EntityRecognizerInputDataConfig
EntityRecognizerInputDataConfig'
    { $sel:augmentedManifests:EntityRecognizerInputDataConfig' :: Maybe [AugmentedManifestsListItem]
augmentedManifests =
        Maybe [AugmentedManifestsListItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:annotations:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerAnnotations
annotations = Maybe EntityRecognizerAnnotations
forall a. Maybe a
Prelude.Nothing,
      $sel:dataFormat:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerDataFormat
dataFormat = Maybe EntityRecognizerDataFormat
forall a. Maybe a
Prelude.Nothing,
      $sel:documents:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerDocuments
documents = Maybe EntityRecognizerDocuments
forall a. Maybe a
Prelude.Nothing,
      $sel:entityList:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerEntityList
entityList = Maybe EntityRecognizerEntityList
forall a. Maybe a
Prelude.Nothing,
      $sel:entityTypes:EntityRecognizerInputDataConfig' :: [EntityTypesListItem]
entityTypes = [EntityTypesListItem]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A list of augmented manifest files that provide training data for your
-- custom model. An augmented manifest file is a labeled dataset that is
-- produced by Amazon SageMaker Ground Truth.
--
-- This parameter is required if you set @DataFormat@ to
-- @AUGMENTED_MANIFEST@.
entityRecognizerInputDataConfig_augmentedManifests :: Lens.Lens' EntityRecognizerInputDataConfig (Prelude.Maybe [AugmentedManifestsListItem])
entityRecognizerInputDataConfig_augmentedManifests :: (Maybe [AugmentedManifestsListItem]
 -> f (Maybe [AugmentedManifestsListItem]))
-> EntityRecognizerInputDataConfig
-> f EntityRecognizerInputDataConfig
entityRecognizerInputDataConfig_augmentedManifests = (EntityRecognizerInputDataConfig
 -> Maybe [AugmentedManifestsListItem])
-> (EntityRecognizerInputDataConfig
    -> Maybe [AugmentedManifestsListItem]
    -> EntityRecognizerInputDataConfig)
-> Lens
     EntityRecognizerInputDataConfig
     EntityRecognizerInputDataConfig
     (Maybe [AugmentedManifestsListItem])
     (Maybe [AugmentedManifestsListItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerInputDataConfig' {Maybe [AugmentedManifestsListItem]
augmentedManifests :: Maybe [AugmentedManifestsListItem]
$sel:augmentedManifests:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig
-> Maybe [AugmentedManifestsListItem]
augmentedManifests} -> Maybe [AugmentedManifestsListItem]
augmentedManifests) (\s :: EntityRecognizerInputDataConfig
s@EntityRecognizerInputDataConfig' {} Maybe [AugmentedManifestsListItem]
a -> EntityRecognizerInputDataConfig
s {$sel:augmentedManifests:EntityRecognizerInputDataConfig' :: Maybe [AugmentedManifestsListItem]
augmentedManifests = Maybe [AugmentedManifestsListItem]
a} :: EntityRecognizerInputDataConfig) ((Maybe [AugmentedManifestsListItem]
  -> f (Maybe [AugmentedManifestsListItem]))
 -> EntityRecognizerInputDataConfig
 -> f EntityRecognizerInputDataConfig)
-> ((Maybe [AugmentedManifestsListItem]
     -> f (Maybe [AugmentedManifestsListItem]))
    -> Maybe [AugmentedManifestsListItem]
    -> f (Maybe [AugmentedManifestsListItem]))
-> (Maybe [AugmentedManifestsListItem]
    -> f (Maybe [AugmentedManifestsListItem]))
-> EntityRecognizerInputDataConfig
-> f EntityRecognizerInputDataConfig
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

-- | The S3 location of the CSV file that annotates your training documents.
entityRecognizerInputDataConfig_annotations :: Lens.Lens' EntityRecognizerInputDataConfig (Prelude.Maybe EntityRecognizerAnnotations)
entityRecognizerInputDataConfig_annotations :: (Maybe EntityRecognizerAnnotations
 -> f (Maybe EntityRecognizerAnnotations))
-> EntityRecognizerInputDataConfig
-> f EntityRecognizerInputDataConfig
entityRecognizerInputDataConfig_annotations = (EntityRecognizerInputDataConfig
 -> Maybe EntityRecognizerAnnotations)
-> (EntityRecognizerInputDataConfig
    -> Maybe EntityRecognizerAnnotations
    -> EntityRecognizerInputDataConfig)
-> Lens
     EntityRecognizerInputDataConfig
     EntityRecognizerInputDataConfig
     (Maybe EntityRecognizerAnnotations)
     (Maybe EntityRecognizerAnnotations)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerInputDataConfig' {Maybe EntityRecognizerAnnotations
annotations :: Maybe EntityRecognizerAnnotations
$sel:annotations:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig
-> Maybe EntityRecognizerAnnotations
annotations} -> Maybe EntityRecognizerAnnotations
annotations) (\s :: EntityRecognizerInputDataConfig
s@EntityRecognizerInputDataConfig' {} Maybe EntityRecognizerAnnotations
a -> EntityRecognizerInputDataConfig
s {$sel:annotations:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerAnnotations
annotations = Maybe EntityRecognizerAnnotations
a} :: EntityRecognizerInputDataConfig)

-- | The format of your training data:
--
-- -   @COMPREHEND_CSV@: A CSV file that supplements your training
--     documents. The CSV file contains information about the custom
--     entities that your trained model will detect. The required format of
--     the file depends on whether you are providing annotations or an
--     entity list.
--
--     If you use this value, you must provide your CSV file by using
--     either the @Annotations@ or @EntityList@ parameters. You must
--     provide your training documents by using the @Documents@ parameter.
--
-- -   @AUGMENTED_MANIFEST@: A labeled dataset that is produced by Amazon
--     SageMaker Ground Truth. This file is in JSON lines format. Each line
--     is a complete JSON object that contains a training document and its
--     labels. Each label annotates a named entity in the training
--     document.
--
--     If you use this value, you must provide the @AugmentedManifests@
--     parameter in your request.
--
-- If you don\'t specify a value, Amazon Comprehend uses @COMPREHEND_CSV@
-- as the default.
entityRecognizerInputDataConfig_dataFormat :: Lens.Lens' EntityRecognizerInputDataConfig (Prelude.Maybe EntityRecognizerDataFormat)
entityRecognizerInputDataConfig_dataFormat :: (Maybe EntityRecognizerDataFormat
 -> f (Maybe EntityRecognizerDataFormat))
-> EntityRecognizerInputDataConfig
-> f EntityRecognizerInputDataConfig
entityRecognizerInputDataConfig_dataFormat = (EntityRecognizerInputDataConfig
 -> Maybe EntityRecognizerDataFormat)
-> (EntityRecognizerInputDataConfig
    -> Maybe EntityRecognizerDataFormat
    -> EntityRecognizerInputDataConfig)
-> Lens
     EntityRecognizerInputDataConfig
     EntityRecognizerInputDataConfig
     (Maybe EntityRecognizerDataFormat)
     (Maybe EntityRecognizerDataFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerInputDataConfig' {Maybe EntityRecognizerDataFormat
dataFormat :: Maybe EntityRecognizerDataFormat
$sel:dataFormat:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDataFormat
dataFormat} -> Maybe EntityRecognizerDataFormat
dataFormat) (\s :: EntityRecognizerInputDataConfig
s@EntityRecognizerInputDataConfig' {} Maybe EntityRecognizerDataFormat
a -> EntityRecognizerInputDataConfig
s {$sel:dataFormat:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerDataFormat
dataFormat = Maybe EntityRecognizerDataFormat
a} :: EntityRecognizerInputDataConfig)

-- | The S3 location of the folder that contains the training documents for
-- your custom entity recognizer.
--
-- This parameter is required if you set @DataFormat@ to @COMPREHEND_CSV@.
entityRecognizerInputDataConfig_documents :: Lens.Lens' EntityRecognizerInputDataConfig (Prelude.Maybe EntityRecognizerDocuments)
entityRecognizerInputDataConfig_documents :: (Maybe EntityRecognizerDocuments
 -> f (Maybe EntityRecognizerDocuments))
-> EntityRecognizerInputDataConfig
-> f EntityRecognizerInputDataConfig
entityRecognizerInputDataConfig_documents = (EntityRecognizerInputDataConfig
 -> Maybe EntityRecognizerDocuments)
-> (EntityRecognizerInputDataConfig
    -> Maybe EntityRecognizerDocuments
    -> EntityRecognizerInputDataConfig)
-> Lens
     EntityRecognizerInputDataConfig
     EntityRecognizerInputDataConfig
     (Maybe EntityRecognizerDocuments)
     (Maybe EntityRecognizerDocuments)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerInputDataConfig' {Maybe EntityRecognizerDocuments
documents :: Maybe EntityRecognizerDocuments
$sel:documents:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDocuments
documents} -> Maybe EntityRecognizerDocuments
documents) (\s :: EntityRecognizerInputDataConfig
s@EntityRecognizerInputDataConfig' {} Maybe EntityRecognizerDocuments
a -> EntityRecognizerInputDataConfig
s {$sel:documents:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerDocuments
documents = Maybe EntityRecognizerDocuments
a} :: EntityRecognizerInputDataConfig)

-- | The S3 location of the CSV file that has the entity list for your custom
-- entity recognizer.
entityRecognizerInputDataConfig_entityList :: Lens.Lens' EntityRecognizerInputDataConfig (Prelude.Maybe EntityRecognizerEntityList)
entityRecognizerInputDataConfig_entityList :: (Maybe EntityRecognizerEntityList
 -> f (Maybe EntityRecognizerEntityList))
-> EntityRecognizerInputDataConfig
-> f EntityRecognizerInputDataConfig
entityRecognizerInputDataConfig_entityList = (EntityRecognizerInputDataConfig
 -> Maybe EntityRecognizerEntityList)
-> (EntityRecognizerInputDataConfig
    -> Maybe EntityRecognizerEntityList
    -> EntityRecognizerInputDataConfig)
-> Lens
     EntityRecognizerInputDataConfig
     EntityRecognizerInputDataConfig
     (Maybe EntityRecognizerEntityList)
     (Maybe EntityRecognizerEntityList)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerInputDataConfig' {Maybe EntityRecognizerEntityList
entityList :: Maybe EntityRecognizerEntityList
$sel:entityList:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerEntityList
entityList} -> Maybe EntityRecognizerEntityList
entityList) (\s :: EntityRecognizerInputDataConfig
s@EntityRecognizerInputDataConfig' {} Maybe EntityRecognizerEntityList
a -> EntityRecognizerInputDataConfig
s {$sel:entityList:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerEntityList
entityList = Maybe EntityRecognizerEntityList
a} :: EntityRecognizerInputDataConfig)

-- | The entity types in the labeled training data that Amazon Comprehend
-- uses to train the custom entity recognizer. Any entity types that you
-- don\'t specify are ignored.
--
-- A maximum of 25 entity types can be used at one time to train an entity
-- recognizer. Entity types must not contain the following invalid
-- characters: \\n (line break), \\\\n (escaped line break), \\r (carriage
-- return), \\\\r (escaped carriage return), \\t (tab), \\\\t (escaped
-- tab), space, and , (comma).
entityRecognizerInputDataConfig_entityTypes :: Lens.Lens' EntityRecognizerInputDataConfig [EntityTypesListItem]
entityRecognizerInputDataConfig_entityTypes :: ([EntityTypesListItem] -> f [EntityTypesListItem])
-> EntityRecognizerInputDataConfig
-> f EntityRecognizerInputDataConfig
entityRecognizerInputDataConfig_entityTypes = (EntityRecognizerInputDataConfig -> [EntityTypesListItem])
-> (EntityRecognizerInputDataConfig
    -> [EntityTypesListItem] -> EntityRecognizerInputDataConfig)
-> Lens
     EntityRecognizerInputDataConfig
     EntityRecognizerInputDataConfig
     [EntityTypesListItem]
     [EntityTypesListItem]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerInputDataConfig' {[EntityTypesListItem]
entityTypes :: [EntityTypesListItem]
$sel:entityTypes:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> [EntityTypesListItem]
entityTypes} -> [EntityTypesListItem]
entityTypes) (\s :: EntityRecognizerInputDataConfig
s@EntityRecognizerInputDataConfig' {} [EntityTypesListItem]
a -> EntityRecognizerInputDataConfig
s {$sel:entityTypes:EntityRecognizerInputDataConfig' :: [EntityTypesListItem]
entityTypes = [EntityTypesListItem]
a} :: EntityRecognizerInputDataConfig) (([EntityTypesListItem] -> f [EntityTypesListItem])
 -> EntityRecognizerInputDataConfig
 -> f EntityRecognizerInputDataConfig)
-> (([EntityTypesListItem] -> f [EntityTypesListItem])
    -> [EntityTypesListItem] -> f [EntityTypesListItem])
-> ([EntityTypesListItem] -> f [EntityTypesListItem])
-> EntityRecognizerInputDataConfig
-> f EntityRecognizerInputDataConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([EntityTypesListItem] -> f [EntityTypesListItem])
-> [EntityTypesListItem] -> f [EntityTypesListItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.FromJSON
    EntityRecognizerInputDataConfig
  where
  parseJSON :: Value -> Parser EntityRecognizerInputDataConfig
parseJSON =
    String
-> (Object -> Parser EntityRecognizerInputDataConfig)
-> Value
-> Parser EntityRecognizerInputDataConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EntityRecognizerInputDataConfig"
      ( \Object
x ->
          Maybe [AugmentedManifestsListItem]
-> Maybe EntityRecognizerAnnotations
-> Maybe EntityRecognizerDataFormat
-> Maybe EntityRecognizerDocuments
-> Maybe EntityRecognizerEntityList
-> [EntityTypesListItem]
-> EntityRecognizerInputDataConfig
EntityRecognizerInputDataConfig'
            (Maybe [AugmentedManifestsListItem]
 -> Maybe EntityRecognizerAnnotations
 -> Maybe EntityRecognizerDataFormat
 -> Maybe EntityRecognizerDocuments
 -> Maybe EntityRecognizerEntityList
 -> [EntityTypesListItem]
 -> EntityRecognizerInputDataConfig)
-> Parser (Maybe [AugmentedManifestsListItem])
-> Parser
     (Maybe EntityRecognizerAnnotations
      -> Maybe EntityRecognizerDataFormat
      -> Maybe EntityRecognizerDocuments
      -> Maybe EntityRecognizerEntityList
      -> [EntityTypesListItem]
      -> EntityRecognizerInputDataConfig)
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 EntityRecognizerAnnotations
   -> Maybe EntityRecognizerDataFormat
   -> Maybe EntityRecognizerDocuments
   -> Maybe EntityRecognizerEntityList
   -> [EntityTypesListItem]
   -> EntityRecognizerInputDataConfig)
-> Parser (Maybe EntityRecognizerAnnotations)
-> Parser
     (Maybe EntityRecognizerDataFormat
      -> Maybe EntityRecognizerDocuments
      -> Maybe EntityRecognizerEntityList
      -> [EntityTypesListItem]
      -> EntityRecognizerInputDataConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EntityRecognizerAnnotations)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Annotations")
            Parser
  (Maybe EntityRecognizerDataFormat
   -> Maybe EntityRecognizerDocuments
   -> Maybe EntityRecognizerEntityList
   -> [EntityTypesListItem]
   -> EntityRecognizerInputDataConfig)
-> Parser (Maybe EntityRecognizerDataFormat)
-> Parser
     (Maybe EntityRecognizerDocuments
      -> Maybe EntityRecognizerEntityList
      -> [EntityTypesListItem]
      -> EntityRecognizerInputDataConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EntityRecognizerDataFormat)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DataFormat")
            Parser
  (Maybe EntityRecognizerDocuments
   -> Maybe EntityRecognizerEntityList
   -> [EntityTypesListItem]
   -> EntityRecognizerInputDataConfig)
-> Parser (Maybe EntityRecognizerDocuments)
-> Parser
     (Maybe EntityRecognizerEntityList
      -> [EntityTypesListItem] -> EntityRecognizerInputDataConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EntityRecognizerDocuments)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Documents")
            Parser
  (Maybe EntityRecognizerEntityList
   -> [EntityTypesListItem] -> EntityRecognizerInputDataConfig)
-> Parser (Maybe EntityRecognizerEntityList)
-> Parser
     ([EntityTypesListItem] -> EntityRecognizerInputDataConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EntityRecognizerEntityList)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EntityList")
            Parser ([EntityTypesListItem] -> EntityRecognizerInputDataConfig)
-> Parser [EntityTypesListItem]
-> Parser EntityRecognizerInputDataConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [EntityTypesListItem])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EntityTypes" Parser (Maybe [EntityTypesListItem])
-> [EntityTypesListItem] -> Parser [EntityTypesListItem]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [EntityTypesListItem]
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    EntityRecognizerInputDataConfig

instance
  Prelude.NFData
    EntityRecognizerInputDataConfig

instance Core.ToJSON EntityRecognizerInputDataConfig where
  toJSON :: EntityRecognizerInputDataConfig -> Value
toJSON EntityRecognizerInputDataConfig' {[EntityTypesListItem]
Maybe [AugmentedManifestsListItem]
Maybe EntityRecognizerAnnotations
Maybe EntityRecognizerDataFormat
Maybe EntityRecognizerEntityList
Maybe EntityRecognizerDocuments
entityTypes :: [EntityTypesListItem]
entityList :: Maybe EntityRecognizerEntityList
documents :: Maybe EntityRecognizerDocuments
dataFormat :: Maybe EntityRecognizerDataFormat
annotations :: Maybe EntityRecognizerAnnotations
augmentedManifests :: Maybe [AugmentedManifestsListItem]
$sel:entityTypes:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> [EntityTypesListItem]
$sel:entityList:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerEntityList
$sel:documents:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDocuments
$sel:dataFormat:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDataFormat
$sel:annotations:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig
-> Maybe EntityRecognizerAnnotations
$sel:augmentedManifests:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig
-> 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
"Annotations" Text -> EntityRecognizerAnnotations -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EntityRecognizerAnnotations -> Pair)
-> Maybe EntityRecognizerAnnotations -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EntityRecognizerAnnotations
annotations,
            (Text
"DataFormat" Text -> EntityRecognizerDataFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EntityRecognizerDataFormat -> Pair)
-> Maybe EntityRecognizerDataFormat -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EntityRecognizerDataFormat
dataFormat,
            (Text
"Documents" Text -> EntityRecognizerDocuments -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EntityRecognizerDocuments -> Pair)
-> Maybe EntityRecognizerDocuments -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EntityRecognizerDocuments
documents,
            (Text
"EntityList" Text -> EntityRecognizerEntityList -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EntityRecognizerEntityList -> Pair)
-> Maybe EntityRecognizerEntityList -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EntityRecognizerEntityList
entityList,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EntityTypes" Text -> [EntityTypesListItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [EntityTypesListItem]
entityTypes)
          ]
      )