{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.LabelingJobS3DataSource where

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

-- | 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
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]
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
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. 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'
    { $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 :: Lens' LabelingJobS3DataSource Text
labelingJobS3DataSource_manifestS3Uri = 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 Data.FromJSON LabelingJobS3DataSource where
  parseJSON :: Value -> Parser LabelingJobS3DataSource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LabelingJobS3DataSource"
      ( \Object
x ->
          Text -> LabelingJobS3DataSource
LabelingJobS3DataSource'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ManifestS3Uri")
      )

instance Prelude.Hashable LabelingJobS3DataSource where
  hashWithSalt :: Int -> LabelingJobS3DataSource -> Int
hashWithSalt Int
_salt LabelingJobS3DataSource' {Text
manifestS3Uri :: Text
$sel:manifestS3Uri:LabelingJobS3DataSource' :: LabelingJobS3DataSource -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
manifestS3Uri

instance Prelude.NFData LabelingJobS3DataSource where
  rnf :: LabelingJobS3DataSource -> ()
rnf LabelingJobS3DataSource' {Text
manifestS3Uri :: Text
$sel:manifestS3Uri:LabelingJobS3DataSource' :: LabelingJobS3DataSource -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
manifestS3Uri

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