{-# 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.AutoMLCandidateGenerationConfig
-- 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.AutoMLCandidateGenerationConfig 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

-- | Stores the config information for how a candidate is generated
-- (optional).
--
-- /See:/ 'newAutoMLCandidateGenerationConfig' smart constructor.
data AutoMLCandidateGenerationConfig = AutoMLCandidateGenerationConfig'
  { -- | A URL to the Amazon S3 data source containing selected features from the
    -- input data source to run an Autopilot job. You can input
    -- @FeatureAttributeNames@ (optional) in JSON format as shown below:
    --
    -- @{ \"FeatureAttributeNames\":[\"col1\", \"col2\", ...] }@.
    --
    -- You can also specify the data type of the feature (optional) in the
    -- format shown below:
    --
    -- @{ \"FeatureDataTypes\":{\"col1\":\"numeric\", \"col2\":\"categorical\" ... } }@
    --
    -- These column keys may not include the target column.
    --
    -- In ensembling mode, Autopilot will only support the following data
    -- types: @numeric@, @categorical@, @text@ and @datetime@. In HPO mode,
    -- Autopilot can support @numeric@, @categorical@, @text@, @datetime@ and
    -- @sequence@.
    --
    -- If only @FeatureDataTypes@ is provided, the column keys (@col1@,
    -- @col2@,..) should be a subset of the column names in the input data.
    --
    -- If both @FeatureDataTypes@ and @FeatureAttributeNames@ are provided,
    -- then the column keys should be a subset of the column names provided in
    -- @FeatureAttributeNames@.
    --
    -- The key name @FeatureAttributeNames@ is fixed. The values listed in
    -- @[\"col1\", \"col2\", ...]@ is case sensitive and should be a list of
    -- strings containing unique values that are a subset of the column names
    -- in the input data. The list of columns provided must not include the
    -- target column.
    AutoMLCandidateGenerationConfig -> Maybe Text
featureSpecificationS3Uri :: Prelude.Maybe Prelude.Text
  }
  deriving (AutoMLCandidateGenerationConfig
-> AutoMLCandidateGenerationConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoMLCandidateGenerationConfig
-> AutoMLCandidateGenerationConfig -> Bool
$c/= :: AutoMLCandidateGenerationConfig
-> AutoMLCandidateGenerationConfig -> Bool
== :: AutoMLCandidateGenerationConfig
-> AutoMLCandidateGenerationConfig -> Bool
$c== :: AutoMLCandidateGenerationConfig
-> AutoMLCandidateGenerationConfig -> Bool
Prelude.Eq, ReadPrec [AutoMLCandidateGenerationConfig]
ReadPrec AutoMLCandidateGenerationConfig
Int -> ReadS AutoMLCandidateGenerationConfig
ReadS [AutoMLCandidateGenerationConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoMLCandidateGenerationConfig]
$creadListPrec :: ReadPrec [AutoMLCandidateGenerationConfig]
readPrec :: ReadPrec AutoMLCandidateGenerationConfig
$creadPrec :: ReadPrec AutoMLCandidateGenerationConfig
readList :: ReadS [AutoMLCandidateGenerationConfig]
$creadList :: ReadS [AutoMLCandidateGenerationConfig]
readsPrec :: Int -> ReadS AutoMLCandidateGenerationConfig
$creadsPrec :: Int -> ReadS AutoMLCandidateGenerationConfig
Prelude.Read, Int -> AutoMLCandidateGenerationConfig -> ShowS
[AutoMLCandidateGenerationConfig] -> ShowS
AutoMLCandidateGenerationConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoMLCandidateGenerationConfig] -> ShowS
$cshowList :: [AutoMLCandidateGenerationConfig] -> ShowS
show :: AutoMLCandidateGenerationConfig -> String
$cshow :: AutoMLCandidateGenerationConfig -> String
showsPrec :: Int -> AutoMLCandidateGenerationConfig -> ShowS
$cshowsPrec :: Int -> AutoMLCandidateGenerationConfig -> ShowS
Prelude.Show, forall x.
Rep AutoMLCandidateGenerationConfig x
-> AutoMLCandidateGenerationConfig
forall x.
AutoMLCandidateGenerationConfig
-> Rep AutoMLCandidateGenerationConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoMLCandidateGenerationConfig x
-> AutoMLCandidateGenerationConfig
$cfrom :: forall x.
AutoMLCandidateGenerationConfig
-> Rep AutoMLCandidateGenerationConfig x
Prelude.Generic)

-- |
-- Create a value of 'AutoMLCandidateGenerationConfig' 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:
--
-- 'featureSpecificationS3Uri', 'autoMLCandidateGenerationConfig_featureSpecificationS3Uri' - A URL to the Amazon S3 data source containing selected features from the
-- input data source to run an Autopilot job. You can input
-- @FeatureAttributeNames@ (optional) in JSON format as shown below:
--
-- @{ \"FeatureAttributeNames\":[\"col1\", \"col2\", ...] }@.
--
-- You can also specify the data type of the feature (optional) in the
-- format shown below:
--
-- @{ \"FeatureDataTypes\":{\"col1\":\"numeric\", \"col2\":\"categorical\" ... } }@
--
-- These column keys may not include the target column.
--
-- In ensembling mode, Autopilot will only support the following data
-- types: @numeric@, @categorical@, @text@ and @datetime@. In HPO mode,
-- Autopilot can support @numeric@, @categorical@, @text@, @datetime@ and
-- @sequence@.
--
-- If only @FeatureDataTypes@ is provided, the column keys (@col1@,
-- @col2@,..) should be a subset of the column names in the input data.
--
-- If both @FeatureDataTypes@ and @FeatureAttributeNames@ are provided,
-- then the column keys should be a subset of the column names provided in
-- @FeatureAttributeNames@.
--
-- The key name @FeatureAttributeNames@ is fixed. The values listed in
-- @[\"col1\", \"col2\", ...]@ is case sensitive and should be a list of
-- strings containing unique values that are a subset of the column names
-- in the input data. The list of columns provided must not include the
-- target column.
newAutoMLCandidateGenerationConfig ::
  AutoMLCandidateGenerationConfig
newAutoMLCandidateGenerationConfig :: AutoMLCandidateGenerationConfig
newAutoMLCandidateGenerationConfig =
  AutoMLCandidateGenerationConfig'
    { $sel:featureSpecificationS3Uri:AutoMLCandidateGenerationConfig' :: Maybe Text
featureSpecificationS3Uri =
        forall a. Maybe a
Prelude.Nothing
    }

-- | A URL to the Amazon S3 data source containing selected features from the
-- input data source to run an Autopilot job. You can input
-- @FeatureAttributeNames@ (optional) in JSON format as shown below:
--
-- @{ \"FeatureAttributeNames\":[\"col1\", \"col2\", ...] }@.
--
-- You can also specify the data type of the feature (optional) in the
-- format shown below:
--
-- @{ \"FeatureDataTypes\":{\"col1\":\"numeric\", \"col2\":\"categorical\" ... } }@
--
-- These column keys may not include the target column.
--
-- In ensembling mode, Autopilot will only support the following data
-- types: @numeric@, @categorical@, @text@ and @datetime@. In HPO mode,
-- Autopilot can support @numeric@, @categorical@, @text@, @datetime@ and
-- @sequence@.
--
-- If only @FeatureDataTypes@ is provided, the column keys (@col1@,
-- @col2@,..) should be a subset of the column names in the input data.
--
-- If both @FeatureDataTypes@ and @FeatureAttributeNames@ are provided,
-- then the column keys should be a subset of the column names provided in
-- @FeatureAttributeNames@.
--
-- The key name @FeatureAttributeNames@ is fixed. The values listed in
-- @[\"col1\", \"col2\", ...]@ is case sensitive and should be a list of
-- strings containing unique values that are a subset of the column names
-- in the input data. The list of columns provided must not include the
-- target column.
autoMLCandidateGenerationConfig_featureSpecificationS3Uri :: Lens.Lens' AutoMLCandidateGenerationConfig (Prelude.Maybe Prelude.Text)
autoMLCandidateGenerationConfig_featureSpecificationS3Uri :: Lens' AutoMLCandidateGenerationConfig (Maybe Text)
autoMLCandidateGenerationConfig_featureSpecificationS3Uri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLCandidateGenerationConfig' {Maybe Text
featureSpecificationS3Uri :: Maybe Text
$sel:featureSpecificationS3Uri:AutoMLCandidateGenerationConfig' :: AutoMLCandidateGenerationConfig -> Maybe Text
featureSpecificationS3Uri} -> Maybe Text
featureSpecificationS3Uri) (\s :: AutoMLCandidateGenerationConfig
s@AutoMLCandidateGenerationConfig' {} Maybe Text
a -> AutoMLCandidateGenerationConfig
s {$sel:featureSpecificationS3Uri:AutoMLCandidateGenerationConfig' :: Maybe Text
featureSpecificationS3Uri = Maybe Text
a} :: AutoMLCandidateGenerationConfig)

instance
  Data.FromJSON
    AutoMLCandidateGenerationConfig
  where
  parseJSON :: Value -> Parser AutoMLCandidateGenerationConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AutoMLCandidateGenerationConfig"
      ( \Object
x ->
          Maybe Text -> AutoMLCandidateGenerationConfig
AutoMLCandidateGenerationConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FeatureSpecificationS3Uri")
      )

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

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

instance Data.ToJSON AutoMLCandidateGenerationConfig where
  toJSON :: AutoMLCandidateGenerationConfig -> Value
toJSON AutoMLCandidateGenerationConfig' {Maybe Text
featureSpecificationS3Uri :: Maybe Text
$sel:featureSpecificationS3Uri:AutoMLCandidateGenerationConfig' :: AutoMLCandidateGenerationConfig -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"FeatureSpecificationS3Uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
featureSpecificationS3Uri
          ]
      )