{-# 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.DocumentClassifierInputDataConfig
-- 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.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

-- | The input properties for training a document classifier.
--
-- For more information on how the input file is formatted, see
-- how-document-classification-training-data.
--
-- /See:/ 'newDocumentClassifierInputDataConfig' smart constructor.
data DocumentClassifierInputDataConfig = DocumentClassifierInputDataConfig'
  { -- | 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@.
    DocumentClassifierInputDataConfig
-> Maybe [AugmentedManifestsListItem]
augmentedManifests :: Prelude.Maybe [AugmentedManifestsListItem],
    -- | The format of your training data:
    --
    -- -   @COMPREHEND_CSV@: A two-column CSV file, where labels are provided
    --     in the first column, and documents are provided in the second. If
    --     you use this value, you must provide the @S3Uri@ parameter in your
    --     request.
    --
    -- -   @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
    --     associated labels.
    --
    --     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.
    DocumentClassifierInputDataConfig
-> Maybe DocumentClassifierDataFormat
dataFormat :: Prelude.Maybe DocumentClassifierDataFormat,
    -- | Indicates the delimiter used to separate each label for training a
    -- multi-label classifier. The default delimiter between labels is a pipe
    -- (|). You can use a different character as a delimiter (if it\'s an
    -- allowed character) by specifying it under Delimiter for labels. If the
    -- training documents use a delimiter other than the default or the
    -- delimiter you specify, the labels on that line will be combined to make
    -- a single unique label, such as LABELLABELLABEL.
    DocumentClassifierInputDataConfig -> Maybe Text
labelDelimiter :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 URI for the input data. The Amazon S3 bucket must be in
    -- the same AWS Region as the API endpoint that you are calling. The URI
    -- can point to a single input file or it can provide the prefix for a
    -- collection of input files.
    DocumentClassifierInputDataConfig -> Maybe Text
testS3Uri :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 URI for the input data. The S3 bucket must be in the same
    -- region as the API endpoint that you are calling. The URI can point to a
    -- single input file or it can provide the prefix for a collection of input
    -- files.
    --
    -- For example, if you use the URI @S3:\/\/bucketName\/prefix@, if the
    -- prefix is a single file, Amazon Comprehend uses that file as input. If
    -- more than one file begins with the prefix, Amazon Comprehend uses all of
    -- them as input.
    --
    -- This parameter is required if you set @DataFormat@ to @COMPREHEND_CSV@.
    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)

-- |
-- Create a value of 'DocumentClassifierInputDataConfig' 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', 'documentClassifierInputDataConfig_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', 'documentClassifierInputDataConfig_dataFormat' - The format of your training data:
--
-- -   @COMPREHEND_CSV@: A two-column CSV file, where labels are provided
--     in the first column, and documents are provided in the second. If
--     you use this value, you must provide the @S3Uri@ parameter in your
--     request.
--
-- -   @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
--     associated labels.
--
--     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.
--
-- 'labelDelimiter', 'documentClassifierInputDataConfig_labelDelimiter' - Indicates the delimiter used to separate each label for training a
-- multi-label classifier. The default delimiter between labels is a pipe
-- (|). You can use a different character as a delimiter (if it\'s an
-- allowed character) by specifying it under Delimiter for labels. If the
-- training documents use a delimiter other than the default or the
-- delimiter you specify, the labels on that line will be combined to make
-- a single unique label, such as LABELLABELLABEL.
--
-- 'testS3Uri', 'documentClassifierInputDataConfig_testS3Uri' - The Amazon S3 URI for the input data. The Amazon S3 bucket must be in
-- the same AWS Region as the API endpoint that you are calling. The URI
-- can point to a single input file or it can provide the prefix for a
-- collection of input files.
--
-- 's3Uri', 'documentClassifierInputDataConfig_s3Uri' - The Amazon S3 URI for the input data. The S3 bucket must be in the same
-- region as the API endpoint that you are calling. The URI can point to a
-- single input file or it can provide the prefix for a collection of input
-- files.
--
-- For example, if you use the URI @S3:\/\/bucketName\/prefix@, if the
-- prefix is a single file, Amazon Comprehend uses that file as input. If
-- more than one file begins with the prefix, Amazon Comprehend uses all of
-- them as input.
--
-- This parameter is required if you set @DataFormat@ to @COMPREHEND_CSV@.
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
    }

-- | 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@.
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

-- | The format of your training data:
--
-- -   @COMPREHEND_CSV@: A two-column CSV file, where labels are provided
--     in the first column, and documents are provided in the second. If
--     you use this value, you must provide the @S3Uri@ parameter in your
--     request.
--
-- -   @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
--     associated labels.
--
--     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.
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)

-- | Indicates the delimiter used to separate each label for training a
-- multi-label classifier. The default delimiter between labels is a pipe
-- (|). You can use a different character as a delimiter (if it\'s an
-- allowed character) by specifying it under Delimiter for labels. If the
-- training documents use a delimiter other than the default or the
-- delimiter you specify, the labels on that line will be combined to make
-- a single unique label, such as LABELLABELLABEL.
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)

-- | The Amazon S3 URI for the input data. The Amazon S3 bucket must be in
-- the same AWS Region as the API endpoint that you are calling. The URI
-- can point to a single input file or it can provide the prefix for a
-- collection of input files.
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)

-- | The Amazon S3 URI for the input data. The S3 bucket must be in the same
-- region as the API endpoint that you are calling. The URI can point to a
-- single input file or it can provide the prefix for a collection of input
-- files.
--
-- For example, if you use the URI @S3:\/\/bucketName\/prefix@, if the
-- prefix is a single file, Amazon Comprehend uses that file as input. If
-- more than one file begins with the prefix, Amazon Comprehend uses all of
-- them as input.
--
-- This parameter is required if you set @DataFormat@ to @COMPREHEND_CSV@.
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
          ]
      )