{-# 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.SageMaker.Types.LabelingJobS3DataSource
-- 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.SageMaker.Types.LabelingJobS3DataSource where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The Amazon S3 location of the input data objects.
--
-- /See:/ 'newLabelingJobS3DataSource' smart constructor.
data LabelingJobS3DataSource = LabelingJobS3DataSource'
  { -- | The Amazon S3 location of the manifest file that describes the input
    -- data objects.
    --
    -- The input manifest file referenced in @ManifestS3Uri@ must contain one
    -- of the following keys: @source-ref@ or @source@. The value of the keys
    -- are interpreted as follows:
    --
    -- -   @source-ref@: The source of the object is the Amazon S3 object
    --     specified in the value. Use this value when the object is a binary
    --     object, such as an image.
    --
    -- -   @source@: The source of the object is the value. Use this value when
    --     the object is a text value.
    --
    -- If you are a new user of Ground Truth, it is recommended you review
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-input-data-input-manifest.html Use an Input Manifest File>
    -- in the Amazon SageMaker Developer Guide to learn how to create an input
    -- manifest file.
    LabelingJobS3DataSource -> Text
manifestS3Uri :: Prelude.Text
  }
  deriving (LabelingJobS3DataSource -> LabelingJobS3DataSource -> Bool
(LabelingJobS3DataSource -> LabelingJobS3DataSource -> Bool)
-> (LabelingJobS3DataSource -> LabelingJobS3DataSource -> Bool)
-> Eq LabelingJobS3DataSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelingJobS3DataSource -> LabelingJobS3DataSource -> Bool
$c/= :: LabelingJobS3DataSource -> LabelingJobS3DataSource -> Bool
== :: LabelingJobS3DataSource -> LabelingJobS3DataSource -> Bool
$c== :: LabelingJobS3DataSource -> LabelingJobS3DataSource -> Bool
Prelude.Eq, ReadPrec [LabelingJobS3DataSource]
ReadPrec LabelingJobS3DataSource
Int -> ReadS LabelingJobS3DataSource
ReadS [LabelingJobS3DataSource]
(Int -> ReadS LabelingJobS3DataSource)
-> ReadS [LabelingJobS3DataSource]
-> ReadPrec LabelingJobS3DataSource
-> ReadPrec [LabelingJobS3DataSource]
-> Read LabelingJobS3DataSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelingJobS3DataSource]
$creadListPrec :: ReadPrec [LabelingJobS3DataSource]
readPrec :: ReadPrec LabelingJobS3DataSource
$creadPrec :: ReadPrec LabelingJobS3DataSource
readList :: ReadS [LabelingJobS3DataSource]
$creadList :: ReadS [LabelingJobS3DataSource]
readsPrec :: Int -> ReadS LabelingJobS3DataSource
$creadsPrec :: Int -> ReadS LabelingJobS3DataSource
Prelude.Read, Int -> LabelingJobS3DataSource -> ShowS
[LabelingJobS3DataSource] -> ShowS
LabelingJobS3DataSource -> String
(Int -> LabelingJobS3DataSource -> ShowS)
-> (LabelingJobS3DataSource -> String)
-> ([LabelingJobS3DataSource] -> ShowS)
-> Show LabelingJobS3DataSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelingJobS3DataSource] -> ShowS
$cshowList :: [LabelingJobS3DataSource] -> ShowS
show :: LabelingJobS3DataSource -> String
$cshow :: LabelingJobS3DataSource -> String
showsPrec :: Int -> LabelingJobS3DataSource -> ShowS
$cshowsPrec :: Int -> LabelingJobS3DataSource -> ShowS
Prelude.Show, (forall x.
 LabelingJobS3DataSource -> Rep LabelingJobS3DataSource x)
-> (forall x.
    Rep LabelingJobS3DataSource x -> LabelingJobS3DataSource)
-> Generic LabelingJobS3DataSource
forall x. Rep LabelingJobS3DataSource x -> LabelingJobS3DataSource
forall x. LabelingJobS3DataSource -> Rep LabelingJobS3DataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LabelingJobS3DataSource x -> LabelingJobS3DataSource
$cfrom :: forall x. LabelingJobS3DataSource -> Rep LabelingJobS3DataSource x
Prelude.Generic)

-- |
-- Create a value of 'LabelingJobS3DataSource' 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:
--
-- 'manifestS3Uri', 'labelingJobS3DataSource_manifestS3Uri' - The Amazon S3 location of the manifest file that describes the input
-- data objects.
--
-- The input manifest file referenced in @ManifestS3Uri@ must contain one
-- of the following keys: @source-ref@ or @source@. The value of the keys
-- are interpreted as follows:
--
-- -   @source-ref@: The source of the object is the Amazon S3 object
--     specified in the value. Use this value when the object is a binary
--     object, such as an image.
--
-- -   @source@: The source of the object is the value. Use this value when
--     the object is a text value.
--
-- If you are a new user of Ground Truth, it is recommended you review
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-input-data-input-manifest.html Use an Input Manifest File>
-- in the Amazon SageMaker Developer Guide to learn how to create an input
-- manifest file.
newLabelingJobS3DataSource ::
  -- | 'manifestS3Uri'
  Prelude.Text ->
  LabelingJobS3DataSource
newLabelingJobS3DataSource :: Text -> LabelingJobS3DataSource
newLabelingJobS3DataSource Text
pManifestS3Uri_ =
  LabelingJobS3DataSource' :: Text -> LabelingJobS3DataSource
LabelingJobS3DataSource'
    { $sel:manifestS3Uri:LabelingJobS3DataSource' :: Text
manifestS3Uri =
        Text
pManifestS3Uri_
    }

-- | The Amazon S3 location of the manifest file that describes the input
-- data objects.
--
-- The input manifest file referenced in @ManifestS3Uri@ must contain one
-- of the following keys: @source-ref@ or @source@. The value of the keys
-- are interpreted as follows:
--
-- -   @source-ref@: The source of the object is the Amazon S3 object
--     specified in the value. Use this value when the object is a binary
--     object, such as an image.
--
-- -   @source@: The source of the object is the value. Use this value when
--     the object is a text value.
--
-- If you are a new user of Ground Truth, it is recommended you review
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-input-data-input-manifest.html Use an Input Manifest File>
-- in the Amazon SageMaker Developer Guide to learn how to create an input
-- manifest file.
labelingJobS3DataSource_manifestS3Uri :: Lens.Lens' LabelingJobS3DataSource Prelude.Text
labelingJobS3DataSource_manifestS3Uri :: (Text -> f Text)
-> LabelingJobS3DataSource -> f LabelingJobS3DataSource
labelingJobS3DataSource_manifestS3Uri = (LabelingJobS3DataSource -> Text)
-> (LabelingJobS3DataSource -> Text -> LabelingJobS3DataSource)
-> Lens LabelingJobS3DataSource LabelingJobS3DataSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelingJobS3DataSource' {Text
manifestS3Uri :: Text
$sel:manifestS3Uri:LabelingJobS3DataSource' :: LabelingJobS3DataSource -> Text
manifestS3Uri} -> Text
manifestS3Uri) (\s :: LabelingJobS3DataSource
s@LabelingJobS3DataSource' {} Text
a -> LabelingJobS3DataSource
s {$sel:manifestS3Uri:LabelingJobS3DataSource' :: Text
manifestS3Uri = Text
a} :: LabelingJobS3DataSource)

instance Core.FromJSON LabelingJobS3DataSource where
  parseJSON :: Value -> Parser LabelingJobS3DataSource
parseJSON =
    String
-> (Object -> Parser LabelingJobS3DataSource)
-> Value
-> Parser LabelingJobS3DataSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LabelingJobS3DataSource"
      ( \Object
x ->
          Text -> LabelingJobS3DataSource
LabelingJobS3DataSource'
            (Text -> LabelingJobS3DataSource)
-> Parser Text -> Parser LabelingJobS3DataSource
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ManifestS3Uri")
      )

instance Prelude.Hashable LabelingJobS3DataSource

instance Prelude.NFData LabelingJobS3DataSource

instance Core.ToJSON LabelingJobS3DataSource where
  toJSON :: LabelingJobS3DataSource -> Value
toJSON LabelingJobS3DataSource' {Text
manifestS3Uri :: Text
$sel:manifestS3Uri:LabelingJobS3DataSource' :: LabelingJobS3DataSource -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ManifestS3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
manifestS3Uri)
          ]
      )