{-# 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.Glue.Types.ImportLabelsTaskRunProperties
-- 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.Glue.Types.ImportLabelsTaskRunProperties where

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

-- | Specifies configuration properties for an importing labels task run.
--
-- /See:/ 'newImportLabelsTaskRunProperties' smart constructor.
data ImportLabelsTaskRunProperties = ImportLabelsTaskRunProperties'
  { -- | Indicates whether to overwrite your existing labels.
    ImportLabelsTaskRunProperties -> Maybe Bool
replace :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Simple Storage Service (Amazon S3) path from where you will
    -- import the labels.
    ImportLabelsTaskRunProperties -> Maybe Text
inputS3Path :: Prelude.Maybe Prelude.Text
  }
  deriving (ImportLabelsTaskRunProperties
-> ImportLabelsTaskRunProperties -> Bool
(ImportLabelsTaskRunProperties
 -> ImportLabelsTaskRunProperties -> Bool)
-> (ImportLabelsTaskRunProperties
    -> ImportLabelsTaskRunProperties -> Bool)
-> Eq ImportLabelsTaskRunProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportLabelsTaskRunProperties
-> ImportLabelsTaskRunProperties -> Bool
$c/= :: ImportLabelsTaskRunProperties
-> ImportLabelsTaskRunProperties -> Bool
== :: ImportLabelsTaskRunProperties
-> ImportLabelsTaskRunProperties -> Bool
$c== :: ImportLabelsTaskRunProperties
-> ImportLabelsTaskRunProperties -> Bool
Prelude.Eq, ReadPrec [ImportLabelsTaskRunProperties]
ReadPrec ImportLabelsTaskRunProperties
Int -> ReadS ImportLabelsTaskRunProperties
ReadS [ImportLabelsTaskRunProperties]
(Int -> ReadS ImportLabelsTaskRunProperties)
-> ReadS [ImportLabelsTaskRunProperties]
-> ReadPrec ImportLabelsTaskRunProperties
-> ReadPrec [ImportLabelsTaskRunProperties]
-> Read ImportLabelsTaskRunProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportLabelsTaskRunProperties]
$creadListPrec :: ReadPrec [ImportLabelsTaskRunProperties]
readPrec :: ReadPrec ImportLabelsTaskRunProperties
$creadPrec :: ReadPrec ImportLabelsTaskRunProperties
readList :: ReadS [ImportLabelsTaskRunProperties]
$creadList :: ReadS [ImportLabelsTaskRunProperties]
readsPrec :: Int -> ReadS ImportLabelsTaskRunProperties
$creadsPrec :: Int -> ReadS ImportLabelsTaskRunProperties
Prelude.Read, Int -> ImportLabelsTaskRunProperties -> ShowS
[ImportLabelsTaskRunProperties] -> ShowS
ImportLabelsTaskRunProperties -> String
(Int -> ImportLabelsTaskRunProperties -> ShowS)
-> (ImportLabelsTaskRunProperties -> String)
-> ([ImportLabelsTaskRunProperties] -> ShowS)
-> Show ImportLabelsTaskRunProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportLabelsTaskRunProperties] -> ShowS
$cshowList :: [ImportLabelsTaskRunProperties] -> ShowS
show :: ImportLabelsTaskRunProperties -> String
$cshow :: ImportLabelsTaskRunProperties -> String
showsPrec :: Int -> ImportLabelsTaskRunProperties -> ShowS
$cshowsPrec :: Int -> ImportLabelsTaskRunProperties -> ShowS
Prelude.Show, (forall x.
 ImportLabelsTaskRunProperties
 -> Rep ImportLabelsTaskRunProperties x)
-> (forall x.
    Rep ImportLabelsTaskRunProperties x
    -> ImportLabelsTaskRunProperties)
-> Generic ImportLabelsTaskRunProperties
forall x.
Rep ImportLabelsTaskRunProperties x
-> ImportLabelsTaskRunProperties
forall x.
ImportLabelsTaskRunProperties
-> Rep ImportLabelsTaskRunProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportLabelsTaskRunProperties x
-> ImportLabelsTaskRunProperties
$cfrom :: forall x.
ImportLabelsTaskRunProperties
-> Rep ImportLabelsTaskRunProperties x
Prelude.Generic)

-- |
-- Create a value of 'ImportLabelsTaskRunProperties' 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:
--
-- 'replace', 'importLabelsTaskRunProperties_replace' - Indicates whether to overwrite your existing labels.
--
-- 'inputS3Path', 'importLabelsTaskRunProperties_inputS3Path' - The Amazon Simple Storage Service (Amazon S3) path from where you will
-- import the labels.
newImportLabelsTaskRunProperties ::
  ImportLabelsTaskRunProperties
newImportLabelsTaskRunProperties :: ImportLabelsTaskRunProperties
newImportLabelsTaskRunProperties =
  ImportLabelsTaskRunProperties' :: Maybe Bool -> Maybe Text -> ImportLabelsTaskRunProperties
ImportLabelsTaskRunProperties'
    { $sel:replace:ImportLabelsTaskRunProperties' :: Maybe Bool
replace =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:inputS3Path:ImportLabelsTaskRunProperties' :: Maybe Text
inputS3Path = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether to overwrite your existing labels.
importLabelsTaskRunProperties_replace :: Lens.Lens' ImportLabelsTaskRunProperties (Prelude.Maybe Prelude.Bool)
importLabelsTaskRunProperties_replace :: (Maybe Bool -> f (Maybe Bool))
-> ImportLabelsTaskRunProperties -> f ImportLabelsTaskRunProperties
importLabelsTaskRunProperties_replace = (ImportLabelsTaskRunProperties -> Maybe Bool)
-> (ImportLabelsTaskRunProperties
    -> Maybe Bool -> ImportLabelsTaskRunProperties)
-> Lens
     ImportLabelsTaskRunProperties
     ImportLabelsTaskRunProperties
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportLabelsTaskRunProperties' {Maybe Bool
replace :: Maybe Bool
$sel:replace:ImportLabelsTaskRunProperties' :: ImportLabelsTaskRunProperties -> Maybe Bool
replace} -> Maybe Bool
replace) (\s :: ImportLabelsTaskRunProperties
s@ImportLabelsTaskRunProperties' {} Maybe Bool
a -> ImportLabelsTaskRunProperties
s {$sel:replace:ImportLabelsTaskRunProperties' :: Maybe Bool
replace = Maybe Bool
a} :: ImportLabelsTaskRunProperties)

-- | The Amazon Simple Storage Service (Amazon S3) path from where you will
-- import the labels.
importLabelsTaskRunProperties_inputS3Path :: Lens.Lens' ImportLabelsTaskRunProperties (Prelude.Maybe Prelude.Text)
importLabelsTaskRunProperties_inputS3Path :: (Maybe Text -> f (Maybe Text))
-> ImportLabelsTaskRunProperties -> f ImportLabelsTaskRunProperties
importLabelsTaskRunProperties_inputS3Path = (ImportLabelsTaskRunProperties -> Maybe Text)
-> (ImportLabelsTaskRunProperties
    -> Maybe Text -> ImportLabelsTaskRunProperties)
-> Lens
     ImportLabelsTaskRunProperties
     ImportLabelsTaskRunProperties
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportLabelsTaskRunProperties' {Maybe Text
inputS3Path :: Maybe Text
$sel:inputS3Path:ImportLabelsTaskRunProperties' :: ImportLabelsTaskRunProperties -> Maybe Text
inputS3Path} -> Maybe Text
inputS3Path) (\s :: ImportLabelsTaskRunProperties
s@ImportLabelsTaskRunProperties' {} Maybe Text
a -> ImportLabelsTaskRunProperties
s {$sel:inputS3Path:ImportLabelsTaskRunProperties' :: Maybe Text
inputS3Path = Maybe Text
a} :: ImportLabelsTaskRunProperties)

instance Core.FromJSON ImportLabelsTaskRunProperties where
  parseJSON :: Value -> Parser ImportLabelsTaskRunProperties
parseJSON =
    String
-> (Object -> Parser ImportLabelsTaskRunProperties)
-> Value
-> Parser ImportLabelsTaskRunProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ImportLabelsTaskRunProperties"
      ( \Object
x ->
          Maybe Bool -> Maybe Text -> ImportLabelsTaskRunProperties
ImportLabelsTaskRunProperties'
            (Maybe Bool -> Maybe Text -> ImportLabelsTaskRunProperties)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> ImportLabelsTaskRunProperties)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Replace")
            Parser (Maybe Text -> ImportLabelsTaskRunProperties)
-> Parser (Maybe Text) -> Parser ImportLabelsTaskRunProperties
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
"InputS3Path")
      )

instance
  Prelude.Hashable
    ImportLabelsTaskRunProperties

instance Prelude.NFData ImportLabelsTaskRunProperties