{-# 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.AugmentedManifestsListItem
-- 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.AugmentedManifestsListItem where

import Amazonka.Comprehend.Types.AugmentedManifestsDocumentTypeFormat
import Amazonka.Comprehend.Types.Split
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An augmented manifest file that provides training data for your custom
-- model. An augmented manifest file is a labeled dataset that is produced
-- by Amazon SageMaker Ground Truth.
--
-- /See:/ 'newAugmentedManifestsListItem' smart constructor.
data AugmentedManifestsListItem = AugmentedManifestsListItem'
  { -- | The S3 prefix to the source files (PDFs) that are referred to in the
    -- augmented manifest file.
    AugmentedManifestsListItem -> Maybe Text
sourceDocumentsS3Uri :: Prelude.Maybe Prelude.Text,
    -- | The type of augmented manifest. PlainTextDocument or
    -- SemiStructuredDocument. If you don\'t specify, the default is
    -- PlainTextDocument.
    --
    -- -   @PLAIN_TEXT_DOCUMENT@ A document type that represents any unicode
    --     text that is encoded in UTF-8.
    --
    -- -   @SEMI_STRUCTURED_DOCUMENT@ A document type with positional and
    --     structural context, like a PDF. For training with Amazon Comprehend,
    --     only PDFs are supported. For inference, Amazon Comprehend support
    --     PDFs, DOCX and TXT.
    AugmentedManifestsListItem
-> Maybe AugmentedManifestsDocumentTypeFormat
documentType :: Prelude.Maybe AugmentedManifestsDocumentTypeFormat,
    -- | The purpose of the data you\'ve provided in the augmented manifest. You
    -- can either train or test this data. If you don\'t specify, the default
    -- is train.
    --
    -- TRAIN - all of the documents in the manifest will be used for training.
    -- If no test documents are provided, Amazon Comprehend will automatically
    -- reserve a portion of the training documents for testing.
    --
    -- TEST - all of the documents in the manifest will be used for testing.
    AugmentedManifestsListItem -> Maybe Split
split :: Prelude.Maybe Split,
    -- | The S3 prefix to the annotation files that are referred in the augmented
    -- manifest file.
    AugmentedManifestsListItem -> Maybe Text
annotationDataS3Uri :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 location of the augmented manifest file.
    AugmentedManifestsListItem -> Text
s3Uri :: Prelude.Text,
    -- | The JSON attribute that contains the annotations for your training
    -- documents. The number of attribute names that you specify depends on
    -- whether your augmented manifest file is the output of a single labeling
    -- job or a chained labeling job.
    --
    -- If your file is the output of a single labeling job, specify the
    -- LabelAttributeName key that was used when the job was created in Ground
    -- Truth.
    --
    -- If your file is the output of a chained labeling job, specify the
    -- LabelAttributeName key for one or more jobs in the chain. Each
    -- LabelAttributeName key provides the annotations from an individual job.
    AugmentedManifestsListItem -> [Text]
attributeNames :: [Prelude.Text]
  }
  deriving (AugmentedManifestsListItem -> AugmentedManifestsListItem -> Bool
(AugmentedManifestsListItem -> AugmentedManifestsListItem -> Bool)
-> (AugmentedManifestsListItem
    -> AugmentedManifestsListItem -> Bool)
-> Eq AugmentedManifestsListItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AugmentedManifestsListItem -> AugmentedManifestsListItem -> Bool
$c/= :: AugmentedManifestsListItem -> AugmentedManifestsListItem -> Bool
== :: AugmentedManifestsListItem -> AugmentedManifestsListItem -> Bool
$c== :: AugmentedManifestsListItem -> AugmentedManifestsListItem -> Bool
Prelude.Eq, ReadPrec [AugmentedManifestsListItem]
ReadPrec AugmentedManifestsListItem
Int -> ReadS AugmentedManifestsListItem
ReadS [AugmentedManifestsListItem]
(Int -> ReadS AugmentedManifestsListItem)
-> ReadS [AugmentedManifestsListItem]
-> ReadPrec AugmentedManifestsListItem
-> ReadPrec [AugmentedManifestsListItem]
-> Read AugmentedManifestsListItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AugmentedManifestsListItem]
$creadListPrec :: ReadPrec [AugmentedManifestsListItem]
readPrec :: ReadPrec AugmentedManifestsListItem
$creadPrec :: ReadPrec AugmentedManifestsListItem
readList :: ReadS [AugmentedManifestsListItem]
$creadList :: ReadS [AugmentedManifestsListItem]
readsPrec :: Int -> ReadS AugmentedManifestsListItem
$creadsPrec :: Int -> ReadS AugmentedManifestsListItem
Prelude.Read, Int -> AugmentedManifestsListItem -> ShowS
[AugmentedManifestsListItem] -> ShowS
AugmentedManifestsListItem -> String
(Int -> AugmentedManifestsListItem -> ShowS)
-> (AugmentedManifestsListItem -> String)
-> ([AugmentedManifestsListItem] -> ShowS)
-> Show AugmentedManifestsListItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AugmentedManifestsListItem] -> ShowS
$cshowList :: [AugmentedManifestsListItem] -> ShowS
show :: AugmentedManifestsListItem -> String
$cshow :: AugmentedManifestsListItem -> String
showsPrec :: Int -> AugmentedManifestsListItem -> ShowS
$cshowsPrec :: Int -> AugmentedManifestsListItem -> ShowS
Prelude.Show, (forall x.
 AugmentedManifestsListItem -> Rep AugmentedManifestsListItem x)
-> (forall x.
    Rep AugmentedManifestsListItem x -> AugmentedManifestsListItem)
-> Generic AugmentedManifestsListItem
forall x.
Rep AugmentedManifestsListItem x -> AugmentedManifestsListItem
forall x.
AugmentedManifestsListItem -> Rep AugmentedManifestsListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AugmentedManifestsListItem x -> AugmentedManifestsListItem
$cfrom :: forall x.
AugmentedManifestsListItem -> Rep AugmentedManifestsListItem x
Prelude.Generic)

-- |
-- Create a value of 'AugmentedManifestsListItem' 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:
--
-- 'sourceDocumentsS3Uri', 'augmentedManifestsListItem_sourceDocumentsS3Uri' - The S3 prefix to the source files (PDFs) that are referred to in the
-- augmented manifest file.
--
-- 'documentType', 'augmentedManifestsListItem_documentType' - The type of augmented manifest. PlainTextDocument or
-- SemiStructuredDocument. If you don\'t specify, the default is
-- PlainTextDocument.
--
-- -   @PLAIN_TEXT_DOCUMENT@ A document type that represents any unicode
--     text that is encoded in UTF-8.
--
-- -   @SEMI_STRUCTURED_DOCUMENT@ A document type with positional and
--     structural context, like a PDF. For training with Amazon Comprehend,
--     only PDFs are supported. For inference, Amazon Comprehend support
--     PDFs, DOCX and TXT.
--
-- 'split', 'augmentedManifestsListItem_split' - The purpose of the data you\'ve provided in the augmented manifest. You
-- can either train or test this data. If you don\'t specify, the default
-- is train.
--
-- TRAIN - all of the documents in the manifest will be used for training.
-- If no test documents are provided, Amazon Comprehend will automatically
-- reserve a portion of the training documents for testing.
--
-- TEST - all of the documents in the manifest will be used for testing.
--
-- 'annotationDataS3Uri', 'augmentedManifestsListItem_annotationDataS3Uri' - The S3 prefix to the annotation files that are referred in the augmented
-- manifest file.
--
-- 's3Uri', 'augmentedManifestsListItem_s3Uri' - The Amazon S3 location of the augmented manifest file.
--
-- 'attributeNames', 'augmentedManifestsListItem_attributeNames' - The JSON attribute that contains the annotations for your training
-- documents. The number of attribute names that you specify depends on
-- whether your augmented manifest file is the output of a single labeling
-- job or a chained labeling job.
--
-- If your file is the output of a single labeling job, specify the
-- LabelAttributeName key that was used when the job was created in Ground
-- Truth.
--
-- If your file is the output of a chained labeling job, specify the
-- LabelAttributeName key for one or more jobs in the chain. Each
-- LabelAttributeName key provides the annotations from an individual job.
newAugmentedManifestsListItem ::
  -- | 's3Uri'
  Prelude.Text ->
  AugmentedManifestsListItem
newAugmentedManifestsListItem :: Text -> AugmentedManifestsListItem
newAugmentedManifestsListItem Text
pS3Uri_ =
  AugmentedManifestsListItem' :: Maybe Text
-> Maybe AugmentedManifestsDocumentTypeFormat
-> Maybe Split
-> Maybe Text
-> Text
-> [Text]
-> AugmentedManifestsListItem
AugmentedManifestsListItem'
    { $sel:sourceDocumentsS3Uri:AugmentedManifestsListItem' :: Maybe Text
sourceDocumentsS3Uri =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:documentType:AugmentedManifestsListItem' :: Maybe AugmentedManifestsDocumentTypeFormat
documentType = Maybe AugmentedManifestsDocumentTypeFormat
forall a. Maybe a
Prelude.Nothing,
      $sel:split:AugmentedManifestsListItem' :: Maybe Split
split = Maybe Split
forall a. Maybe a
Prelude.Nothing,
      $sel:annotationDataS3Uri:AugmentedManifestsListItem' :: Maybe Text
annotationDataS3Uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Uri:AugmentedManifestsListItem' :: Text
s3Uri = Text
pS3Uri_,
      $sel:attributeNames:AugmentedManifestsListItem' :: [Text]
attributeNames = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The S3 prefix to the source files (PDFs) that are referred to in the
-- augmented manifest file.
augmentedManifestsListItem_sourceDocumentsS3Uri :: Lens.Lens' AugmentedManifestsListItem (Prelude.Maybe Prelude.Text)
augmentedManifestsListItem_sourceDocumentsS3Uri :: (Maybe Text -> f (Maybe Text))
-> AugmentedManifestsListItem -> f AugmentedManifestsListItem
augmentedManifestsListItem_sourceDocumentsS3Uri = (AugmentedManifestsListItem -> Maybe Text)
-> (AugmentedManifestsListItem
    -> Maybe Text -> AugmentedManifestsListItem)
-> Lens
     AugmentedManifestsListItem
     AugmentedManifestsListItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AugmentedManifestsListItem' {Maybe Text
sourceDocumentsS3Uri :: Maybe Text
$sel:sourceDocumentsS3Uri:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> Maybe Text
sourceDocumentsS3Uri} -> Maybe Text
sourceDocumentsS3Uri) (\s :: AugmentedManifestsListItem
s@AugmentedManifestsListItem' {} Maybe Text
a -> AugmentedManifestsListItem
s {$sel:sourceDocumentsS3Uri:AugmentedManifestsListItem' :: Maybe Text
sourceDocumentsS3Uri = Maybe Text
a} :: AugmentedManifestsListItem)

-- | The type of augmented manifest. PlainTextDocument or
-- SemiStructuredDocument. If you don\'t specify, the default is
-- PlainTextDocument.
--
-- -   @PLAIN_TEXT_DOCUMENT@ A document type that represents any unicode
--     text that is encoded in UTF-8.
--
-- -   @SEMI_STRUCTURED_DOCUMENT@ A document type with positional and
--     structural context, like a PDF. For training with Amazon Comprehend,
--     only PDFs are supported. For inference, Amazon Comprehend support
--     PDFs, DOCX and TXT.
augmentedManifestsListItem_documentType :: Lens.Lens' AugmentedManifestsListItem (Prelude.Maybe AugmentedManifestsDocumentTypeFormat)
augmentedManifestsListItem_documentType :: (Maybe AugmentedManifestsDocumentTypeFormat
 -> f (Maybe AugmentedManifestsDocumentTypeFormat))
-> AugmentedManifestsListItem -> f AugmentedManifestsListItem
augmentedManifestsListItem_documentType = (AugmentedManifestsListItem
 -> Maybe AugmentedManifestsDocumentTypeFormat)
-> (AugmentedManifestsListItem
    -> Maybe AugmentedManifestsDocumentTypeFormat
    -> AugmentedManifestsListItem)
-> Lens
     AugmentedManifestsListItem
     AugmentedManifestsListItem
     (Maybe AugmentedManifestsDocumentTypeFormat)
     (Maybe AugmentedManifestsDocumentTypeFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AugmentedManifestsListItem' {Maybe AugmentedManifestsDocumentTypeFormat
documentType :: Maybe AugmentedManifestsDocumentTypeFormat
$sel:documentType:AugmentedManifestsListItem' :: AugmentedManifestsListItem
-> Maybe AugmentedManifestsDocumentTypeFormat
documentType} -> Maybe AugmentedManifestsDocumentTypeFormat
documentType) (\s :: AugmentedManifestsListItem
s@AugmentedManifestsListItem' {} Maybe AugmentedManifestsDocumentTypeFormat
a -> AugmentedManifestsListItem
s {$sel:documentType:AugmentedManifestsListItem' :: Maybe AugmentedManifestsDocumentTypeFormat
documentType = Maybe AugmentedManifestsDocumentTypeFormat
a} :: AugmentedManifestsListItem)

-- | The purpose of the data you\'ve provided in the augmented manifest. You
-- can either train or test this data. If you don\'t specify, the default
-- is train.
--
-- TRAIN - all of the documents in the manifest will be used for training.
-- If no test documents are provided, Amazon Comprehend will automatically
-- reserve a portion of the training documents for testing.
--
-- TEST - all of the documents in the manifest will be used for testing.
augmentedManifestsListItem_split :: Lens.Lens' AugmentedManifestsListItem (Prelude.Maybe Split)
augmentedManifestsListItem_split :: (Maybe Split -> f (Maybe Split))
-> AugmentedManifestsListItem -> f AugmentedManifestsListItem
augmentedManifestsListItem_split = (AugmentedManifestsListItem -> Maybe Split)
-> (AugmentedManifestsListItem
    -> Maybe Split -> AugmentedManifestsListItem)
-> Lens
     AugmentedManifestsListItem
     AugmentedManifestsListItem
     (Maybe Split)
     (Maybe Split)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AugmentedManifestsListItem' {Maybe Split
split :: Maybe Split
$sel:split:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> Maybe Split
split} -> Maybe Split
split) (\s :: AugmentedManifestsListItem
s@AugmentedManifestsListItem' {} Maybe Split
a -> AugmentedManifestsListItem
s {$sel:split:AugmentedManifestsListItem' :: Maybe Split
split = Maybe Split
a} :: AugmentedManifestsListItem)

-- | The S3 prefix to the annotation files that are referred in the augmented
-- manifest file.
augmentedManifestsListItem_annotationDataS3Uri :: Lens.Lens' AugmentedManifestsListItem (Prelude.Maybe Prelude.Text)
augmentedManifestsListItem_annotationDataS3Uri :: (Maybe Text -> f (Maybe Text))
-> AugmentedManifestsListItem -> f AugmentedManifestsListItem
augmentedManifestsListItem_annotationDataS3Uri = (AugmentedManifestsListItem -> Maybe Text)
-> (AugmentedManifestsListItem
    -> Maybe Text -> AugmentedManifestsListItem)
-> Lens
     AugmentedManifestsListItem
     AugmentedManifestsListItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AugmentedManifestsListItem' {Maybe Text
annotationDataS3Uri :: Maybe Text
$sel:annotationDataS3Uri:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> Maybe Text
annotationDataS3Uri} -> Maybe Text
annotationDataS3Uri) (\s :: AugmentedManifestsListItem
s@AugmentedManifestsListItem' {} Maybe Text
a -> AugmentedManifestsListItem
s {$sel:annotationDataS3Uri:AugmentedManifestsListItem' :: Maybe Text
annotationDataS3Uri = Maybe Text
a} :: AugmentedManifestsListItem)

-- | The Amazon S3 location of the augmented manifest file.
augmentedManifestsListItem_s3Uri :: Lens.Lens' AugmentedManifestsListItem Prelude.Text
augmentedManifestsListItem_s3Uri :: (Text -> f Text)
-> AugmentedManifestsListItem -> f AugmentedManifestsListItem
augmentedManifestsListItem_s3Uri = (AugmentedManifestsListItem -> Text)
-> (AugmentedManifestsListItem
    -> Text -> AugmentedManifestsListItem)
-> Lens
     AugmentedManifestsListItem AugmentedManifestsListItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AugmentedManifestsListItem' {Text
s3Uri :: Text
$sel:s3Uri:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> Text
s3Uri} -> Text
s3Uri) (\s :: AugmentedManifestsListItem
s@AugmentedManifestsListItem' {} Text
a -> AugmentedManifestsListItem
s {$sel:s3Uri:AugmentedManifestsListItem' :: Text
s3Uri = Text
a} :: AugmentedManifestsListItem)

-- | The JSON attribute that contains the annotations for your training
-- documents. The number of attribute names that you specify depends on
-- whether your augmented manifest file is the output of a single labeling
-- job or a chained labeling job.
--
-- If your file is the output of a single labeling job, specify the
-- LabelAttributeName key that was used when the job was created in Ground
-- Truth.
--
-- If your file is the output of a chained labeling job, specify the
-- LabelAttributeName key for one or more jobs in the chain. Each
-- LabelAttributeName key provides the annotations from an individual job.
augmentedManifestsListItem_attributeNames :: Lens.Lens' AugmentedManifestsListItem [Prelude.Text]
augmentedManifestsListItem_attributeNames :: ([Text] -> f [Text])
-> AugmentedManifestsListItem -> f AugmentedManifestsListItem
augmentedManifestsListItem_attributeNames = (AugmentedManifestsListItem -> [Text])
-> (AugmentedManifestsListItem
    -> [Text] -> AugmentedManifestsListItem)
-> Lens
     AugmentedManifestsListItem AugmentedManifestsListItem [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AugmentedManifestsListItem' {[Text]
attributeNames :: [Text]
$sel:attributeNames:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> [Text]
attributeNames} -> [Text]
attributeNames) (\s :: AugmentedManifestsListItem
s@AugmentedManifestsListItem' {} [Text]
a -> AugmentedManifestsListItem
s {$sel:attributeNames:AugmentedManifestsListItem' :: [Text]
attributeNames = [Text]
a} :: AugmentedManifestsListItem) (([Text] -> f [Text])
 -> AugmentedManifestsListItem -> f AugmentedManifestsListItem)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> AugmentedManifestsListItem
-> f AugmentedManifestsListItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON AugmentedManifestsListItem where
  parseJSON :: Value -> Parser AugmentedManifestsListItem
parseJSON =
    String
-> (Object -> Parser AugmentedManifestsListItem)
-> Value
-> Parser AugmentedManifestsListItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AugmentedManifestsListItem"
      ( \Object
x ->
          Maybe Text
-> Maybe AugmentedManifestsDocumentTypeFormat
-> Maybe Split
-> Maybe Text
-> Text
-> [Text]
-> AugmentedManifestsListItem
AugmentedManifestsListItem'
            (Maybe Text
 -> Maybe AugmentedManifestsDocumentTypeFormat
 -> Maybe Split
 -> Maybe Text
 -> Text
 -> [Text]
 -> AugmentedManifestsListItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe AugmentedManifestsDocumentTypeFormat
      -> Maybe Split
      -> Maybe Text
      -> Text
      -> [Text]
      -> AugmentedManifestsListItem)
forall (f :: * -> *) a b. Functor 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
"SourceDocumentsS3Uri")
            Parser
  (Maybe AugmentedManifestsDocumentTypeFormat
   -> Maybe Split
   -> Maybe Text
   -> Text
   -> [Text]
   -> AugmentedManifestsListItem)
-> Parser (Maybe AugmentedManifestsDocumentTypeFormat)
-> Parser
     (Maybe Split
      -> Maybe Text -> Text -> [Text] -> AugmentedManifestsListItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe AugmentedManifestsDocumentTypeFormat)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DocumentType")
            Parser
  (Maybe Split
   -> Maybe Text -> Text -> [Text] -> AugmentedManifestsListItem)
-> Parser (Maybe Split)
-> Parser
     (Maybe Text -> Text -> [Text] -> AugmentedManifestsListItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Split)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Split")
            Parser (Maybe Text -> Text -> [Text] -> AugmentedManifestsListItem)
-> Parser (Maybe Text)
-> Parser (Text -> [Text] -> AugmentedManifestsListItem)
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
"AnnotationDataS3Uri")
            Parser (Text -> [Text] -> AugmentedManifestsListItem)
-> Parser Text -> Parser ([Text] -> AugmentedManifestsListItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3Uri")
            Parser ([Text] -> AugmentedManifestsListItem)
-> Parser [Text] -> Parser AugmentedManifestsListItem
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
"AttributeNames"
                            Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable AugmentedManifestsListItem

instance Prelude.NFData AugmentedManifestsListItem

instance Core.ToJSON AugmentedManifestsListItem where
  toJSON :: AugmentedManifestsListItem -> Value
toJSON AugmentedManifestsListItem' {[Text]
Maybe Text
Maybe AugmentedManifestsDocumentTypeFormat
Maybe Split
Text
attributeNames :: [Text]
s3Uri :: Text
annotationDataS3Uri :: Maybe Text
split :: Maybe Split
documentType :: Maybe AugmentedManifestsDocumentTypeFormat
sourceDocumentsS3Uri :: Maybe Text
$sel:attributeNames:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> [Text]
$sel:s3Uri:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> Text
$sel:annotationDataS3Uri:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> Maybe Text
$sel:split:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> Maybe Split
$sel:documentType:AugmentedManifestsListItem' :: AugmentedManifestsListItem
-> Maybe AugmentedManifestsDocumentTypeFormat
$sel:sourceDocumentsS3Uri:AugmentedManifestsListItem' :: AugmentedManifestsListItem -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SourceDocumentsS3Uri" 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
sourceDocumentsS3Uri,
            (Text
"DocumentType" Text -> AugmentedManifestsDocumentTypeFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AugmentedManifestsDocumentTypeFormat -> Pair)
-> Maybe AugmentedManifestsDocumentTypeFormat -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AugmentedManifestsDocumentTypeFormat
documentType,
            (Text
"Split" Text -> Split -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Split -> Pair) -> Maybe Split -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Split
split,
            (Text
"AnnotationDataS3Uri" 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
annotationDataS3Uri,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"S3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3Uri),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AttributeNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
attributeNames)
          ]
      )