{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Specifies the format and location of the input data.
--
-- /See:/ 'newEntityRecognizerInputDataConfig' smart constructor.
data EntityRecognizerInputDataConfig = EntityRecognizerInputDataConfig'
  { -- | The S3 location of the CSV file that annotates your training documents.
    EntityRecognizerInputDataConfig
-> Maybe EntityRecognizerAnnotations
annotations :: Prelude.Maybe EntityRecognizerAnnotations,
    -- | 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 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
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]
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
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.
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:
--
-- 'annotations', 'entityRecognizerInputDataConfig_annotations' - The S3 location of the CSV file that annotates your training documents.
--
-- '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@.
--
-- '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'
    { $sel:annotations:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerAnnotations
annotations =
        forall a. Maybe a
Prelude.Nothing,
      $sel:augmentedManifests:EntityRecognizerInputDataConfig' :: Maybe [AugmentedManifestsListItem]
augmentedManifests = forall a. Maybe a
Prelude.Nothing,
      $sel:dataFormat:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerDataFormat
dataFormat = forall a. Maybe a
Prelude.Nothing,
      $sel:documents:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerDocuments
documents = forall a. Maybe a
Prelude.Nothing,
      $sel:entityList:EntityRecognizerInputDataConfig' :: Maybe EntityRecognizerEntityList
entityList = forall a. Maybe a
Prelude.Nothing,
      $sel:entityTypes:EntityRecognizerInputDataConfig' :: [EntityTypesListItem]
entityTypes = forall a. Monoid a => a
Prelude.mempty
    }

-- | The S3 location of the CSV file that annotates your training documents.
entityRecognizerInputDataConfig_annotations :: Lens.Lens' EntityRecognizerInputDataConfig (Prelude.Maybe EntityRecognizerAnnotations)
entityRecognizerInputDataConfig_annotations :: Lens'
  EntityRecognizerInputDataConfig (Maybe EntityRecognizerAnnotations)
entityRecognizerInputDataConfig_annotations = 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)

-- | 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 :: Lens'
  EntityRecognizerInputDataConfig
  (Maybe [AugmentedManifestsListItem])
entityRecognizerInputDataConfig_augmentedManifests = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: Lens'
  EntityRecognizerInputDataConfig (Maybe EntityRecognizerDataFormat)
entityRecognizerInputDataConfig_dataFormat = 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 :: Lens'
  EntityRecognizerInputDataConfig (Maybe EntityRecognizerDocuments)
entityRecognizerInputDataConfig_documents = 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 :: Lens'
  EntityRecognizerInputDataConfig (Maybe EntityRecognizerEntityList)
entityRecognizerInputDataConfig_entityList = 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 :: Lens' EntityRecognizerInputDataConfig [EntityTypesListItem]
entityRecognizerInputDataConfig_entityTypes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Data.FromJSON
    EntityRecognizerInputDataConfig
  where
  parseJSON :: Value -> Parser EntityRecognizerInputDataConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EntityRecognizerInputDataConfig"
      ( \Object
x ->
          Maybe EntityRecognizerAnnotations
-> Maybe [AugmentedManifestsListItem]
-> Maybe EntityRecognizerDataFormat
-> Maybe EntityRecognizerDocuments
-> Maybe EntityRecognizerEntityList
-> [EntityTypesListItem]
-> EntityRecognizerInputDataConfig
EntityRecognizerInputDataConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Annotations")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AugmentedManifests"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DataFormat")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Documents")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EntityList")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EntityTypes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    EntityRecognizerInputDataConfig
  where
  hashWithSalt :: Int -> EntityRecognizerInputDataConfig -> Int
hashWithSalt
    Int
_salt
    EntityRecognizerInputDataConfig' {[EntityTypesListItem]
Maybe [AugmentedManifestsListItem]
Maybe EntityRecognizerAnnotations
Maybe EntityRecognizerDataFormat
Maybe EntityRecognizerEntityList
Maybe EntityRecognizerDocuments
entityTypes :: [EntityTypesListItem]
entityList :: Maybe EntityRecognizerEntityList
documents :: Maybe EntityRecognizerDocuments
dataFormat :: Maybe EntityRecognizerDataFormat
augmentedManifests :: Maybe [AugmentedManifestsListItem]
annotations :: Maybe EntityRecognizerAnnotations
$sel:entityTypes:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> [EntityTypesListItem]
$sel:entityList:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerEntityList
$sel:documents:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDocuments
$sel:dataFormat:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDataFormat
$sel:augmentedManifests:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig
-> Maybe [AugmentedManifestsListItem]
$sel:annotations:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig
-> Maybe EntityRecognizerAnnotations
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EntityRecognizerAnnotations
annotations
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AugmentedManifestsListItem]
augmentedManifests
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EntityRecognizerDataFormat
dataFormat
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EntityRecognizerDocuments
documents
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EntityRecognizerEntityList
entityList
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [EntityTypesListItem]
entityTypes

instance
  Prelude.NFData
    EntityRecognizerInputDataConfig
  where
  rnf :: EntityRecognizerInputDataConfig -> ()
rnf EntityRecognizerInputDataConfig' {[EntityTypesListItem]
Maybe [AugmentedManifestsListItem]
Maybe EntityRecognizerAnnotations
Maybe EntityRecognizerDataFormat
Maybe EntityRecognizerEntityList
Maybe EntityRecognizerDocuments
entityTypes :: [EntityTypesListItem]
entityList :: Maybe EntityRecognizerEntityList
documents :: Maybe EntityRecognizerDocuments
dataFormat :: Maybe EntityRecognizerDataFormat
augmentedManifests :: Maybe [AugmentedManifestsListItem]
annotations :: Maybe EntityRecognizerAnnotations
$sel:entityTypes:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> [EntityTypesListItem]
$sel:entityList:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerEntityList
$sel:documents:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDocuments
$sel:dataFormat:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig -> Maybe EntityRecognizerDataFormat
$sel:augmentedManifests:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig
-> Maybe [AugmentedManifestsListItem]
$sel:annotations:EntityRecognizerInputDataConfig' :: EntityRecognizerInputDataConfig
-> Maybe EntityRecognizerAnnotations
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe EntityRecognizerAnnotations
annotations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AugmentedManifestsListItem]
augmentedManifests
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EntityRecognizerDataFormat
dataFormat
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EntityRecognizerDocuments
documents
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EntityRecognizerEntityList
entityList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [EntityTypesListItem]
entityTypes

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