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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.ContentClassifier

-- | Attributes of the data specified by the customer. Use these to describe
-- the data to be labeled.
--
-- /See:/ 'newLabelingJobDataAttributes' smart constructor.
data LabelingJobDataAttributes = LabelingJobDataAttributes'
  { -- | Declares that your content is free of personally identifiable
    -- information or adult content. Amazon SageMaker may restrict the Amazon
    -- Mechanical Turk workers that can view your task based on this
    -- information.
    LabelingJobDataAttributes -> Maybe [ContentClassifier]
contentClassifiers :: Prelude.Maybe [ContentClassifier]
  }
  deriving (LabelingJobDataAttributes -> LabelingJobDataAttributes -> Bool
(LabelingJobDataAttributes -> LabelingJobDataAttributes -> Bool)
-> (LabelingJobDataAttributes -> LabelingJobDataAttributes -> Bool)
-> Eq LabelingJobDataAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelingJobDataAttributes -> LabelingJobDataAttributes -> Bool
$c/= :: LabelingJobDataAttributes -> LabelingJobDataAttributes -> Bool
== :: LabelingJobDataAttributes -> LabelingJobDataAttributes -> Bool
$c== :: LabelingJobDataAttributes -> LabelingJobDataAttributes -> Bool
Prelude.Eq, ReadPrec [LabelingJobDataAttributes]
ReadPrec LabelingJobDataAttributes
Int -> ReadS LabelingJobDataAttributes
ReadS [LabelingJobDataAttributes]
(Int -> ReadS LabelingJobDataAttributes)
-> ReadS [LabelingJobDataAttributes]
-> ReadPrec LabelingJobDataAttributes
-> ReadPrec [LabelingJobDataAttributes]
-> Read LabelingJobDataAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelingJobDataAttributes]
$creadListPrec :: ReadPrec [LabelingJobDataAttributes]
readPrec :: ReadPrec LabelingJobDataAttributes
$creadPrec :: ReadPrec LabelingJobDataAttributes
readList :: ReadS [LabelingJobDataAttributes]
$creadList :: ReadS [LabelingJobDataAttributes]
readsPrec :: Int -> ReadS LabelingJobDataAttributes
$creadsPrec :: Int -> ReadS LabelingJobDataAttributes
Prelude.Read, Int -> LabelingJobDataAttributes -> ShowS
[LabelingJobDataAttributes] -> ShowS
LabelingJobDataAttributes -> String
(Int -> LabelingJobDataAttributes -> ShowS)
-> (LabelingJobDataAttributes -> String)
-> ([LabelingJobDataAttributes] -> ShowS)
-> Show LabelingJobDataAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelingJobDataAttributes] -> ShowS
$cshowList :: [LabelingJobDataAttributes] -> ShowS
show :: LabelingJobDataAttributes -> String
$cshow :: LabelingJobDataAttributes -> String
showsPrec :: Int -> LabelingJobDataAttributes -> ShowS
$cshowsPrec :: Int -> LabelingJobDataAttributes -> ShowS
Prelude.Show, (forall x.
 LabelingJobDataAttributes -> Rep LabelingJobDataAttributes x)
-> (forall x.
    Rep LabelingJobDataAttributes x -> LabelingJobDataAttributes)
-> Generic LabelingJobDataAttributes
forall x.
Rep LabelingJobDataAttributes x -> LabelingJobDataAttributes
forall x.
LabelingJobDataAttributes -> Rep LabelingJobDataAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LabelingJobDataAttributes x -> LabelingJobDataAttributes
$cfrom :: forall x.
LabelingJobDataAttributes -> Rep LabelingJobDataAttributes x
Prelude.Generic)

-- |
-- Create a value of 'LabelingJobDataAttributes' 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:
--
-- 'contentClassifiers', 'labelingJobDataAttributes_contentClassifiers' - Declares that your content is free of personally identifiable
-- information or adult content. Amazon SageMaker may restrict the Amazon
-- Mechanical Turk workers that can view your task based on this
-- information.
newLabelingJobDataAttributes ::
  LabelingJobDataAttributes
newLabelingJobDataAttributes :: LabelingJobDataAttributes
newLabelingJobDataAttributes =
  LabelingJobDataAttributes' :: Maybe [ContentClassifier] -> LabelingJobDataAttributes
LabelingJobDataAttributes'
    { $sel:contentClassifiers:LabelingJobDataAttributes' :: Maybe [ContentClassifier]
contentClassifiers =
        Maybe [ContentClassifier]
forall a. Maybe a
Prelude.Nothing
    }

-- | Declares that your content is free of personally identifiable
-- information or adult content. Amazon SageMaker may restrict the Amazon
-- Mechanical Turk workers that can view your task based on this
-- information.
labelingJobDataAttributes_contentClassifiers :: Lens.Lens' LabelingJobDataAttributes (Prelude.Maybe [ContentClassifier])
labelingJobDataAttributes_contentClassifiers :: (Maybe [ContentClassifier] -> f (Maybe [ContentClassifier]))
-> LabelingJobDataAttributes -> f LabelingJobDataAttributes
labelingJobDataAttributes_contentClassifiers = (LabelingJobDataAttributes -> Maybe [ContentClassifier])
-> (LabelingJobDataAttributes
    -> Maybe [ContentClassifier] -> LabelingJobDataAttributes)
-> Lens
     LabelingJobDataAttributes
     LabelingJobDataAttributes
     (Maybe [ContentClassifier])
     (Maybe [ContentClassifier])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelingJobDataAttributes' {Maybe [ContentClassifier]
contentClassifiers :: Maybe [ContentClassifier]
$sel:contentClassifiers:LabelingJobDataAttributes' :: LabelingJobDataAttributes -> Maybe [ContentClassifier]
contentClassifiers} -> Maybe [ContentClassifier]
contentClassifiers) (\s :: LabelingJobDataAttributes
s@LabelingJobDataAttributes' {} Maybe [ContentClassifier]
a -> LabelingJobDataAttributes
s {$sel:contentClassifiers:LabelingJobDataAttributes' :: Maybe [ContentClassifier]
contentClassifiers = Maybe [ContentClassifier]
a} :: LabelingJobDataAttributes) ((Maybe [ContentClassifier] -> f (Maybe [ContentClassifier]))
 -> LabelingJobDataAttributes -> f LabelingJobDataAttributes)
-> ((Maybe [ContentClassifier] -> f (Maybe [ContentClassifier]))
    -> Maybe [ContentClassifier] -> f (Maybe [ContentClassifier]))
-> (Maybe [ContentClassifier] -> f (Maybe [ContentClassifier]))
-> LabelingJobDataAttributes
-> f LabelingJobDataAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ContentClassifier]
  [ContentClassifier]
  [ContentClassifier]
  [ContentClassifier]
-> Iso
     (Maybe [ContentClassifier])
     (Maybe [ContentClassifier])
     (Maybe [ContentClassifier])
     (Maybe [ContentClassifier])
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
  [ContentClassifier]
  [ContentClassifier]
  [ContentClassifier]
  [ContentClassifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON LabelingJobDataAttributes where
  parseJSON :: Value -> Parser LabelingJobDataAttributes
parseJSON =
    String
-> (Object -> Parser LabelingJobDataAttributes)
-> Value
-> Parser LabelingJobDataAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LabelingJobDataAttributes"
      ( \Object
x ->
          Maybe [ContentClassifier] -> LabelingJobDataAttributes
LabelingJobDataAttributes'
            (Maybe [ContentClassifier] -> LabelingJobDataAttributes)
-> Parser (Maybe [ContentClassifier])
-> Parser LabelingJobDataAttributes
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ContentClassifier]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContentClassifiers"
                            Parser (Maybe (Maybe [ContentClassifier]))
-> Maybe [ContentClassifier] -> Parser (Maybe [ContentClassifier])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ContentClassifier]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable LabelingJobDataAttributes

instance Prelude.NFData LabelingJobDataAttributes

instance Core.ToJSON LabelingJobDataAttributes where
  toJSON :: LabelingJobDataAttributes -> Value
toJSON LabelingJobDataAttributes' {Maybe [ContentClassifier]
contentClassifiers :: Maybe [ContentClassifier]
$sel:contentClassifiers:LabelingJobDataAttributes' :: LabelingJobDataAttributes -> Maybe [ContentClassifier]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ContentClassifiers" Text -> [ContentClassifier] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ContentClassifier] -> Pair)
-> Maybe [ContentClassifier] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ContentClassifier]
contentClassifiers
          ]
      )