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

-- | Specifies the names of the experiment and trial created by a pipeline.
--
-- /See:/ 'newPipelineExperimentConfig' smart constructor.
data PipelineExperimentConfig = PipelineExperimentConfig'
  { -- | The name of the experiment.
    PipelineExperimentConfig -> Maybe Text
experimentName :: Prelude.Maybe Prelude.Text,
    -- | The name of the trial.
    PipelineExperimentConfig -> Maybe Text
trialName :: Prelude.Maybe Prelude.Text
  }
  deriving (PipelineExperimentConfig -> PipelineExperimentConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineExperimentConfig -> PipelineExperimentConfig -> Bool
$c/= :: PipelineExperimentConfig -> PipelineExperimentConfig -> Bool
== :: PipelineExperimentConfig -> PipelineExperimentConfig -> Bool
$c== :: PipelineExperimentConfig -> PipelineExperimentConfig -> Bool
Prelude.Eq, ReadPrec [PipelineExperimentConfig]
ReadPrec PipelineExperimentConfig
Int -> ReadS PipelineExperimentConfig
ReadS [PipelineExperimentConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipelineExperimentConfig]
$creadListPrec :: ReadPrec [PipelineExperimentConfig]
readPrec :: ReadPrec PipelineExperimentConfig
$creadPrec :: ReadPrec PipelineExperimentConfig
readList :: ReadS [PipelineExperimentConfig]
$creadList :: ReadS [PipelineExperimentConfig]
readsPrec :: Int -> ReadS PipelineExperimentConfig
$creadsPrec :: Int -> ReadS PipelineExperimentConfig
Prelude.Read, Int -> PipelineExperimentConfig -> ShowS
[PipelineExperimentConfig] -> ShowS
PipelineExperimentConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipelineExperimentConfig] -> ShowS
$cshowList :: [PipelineExperimentConfig] -> ShowS
show :: PipelineExperimentConfig -> String
$cshow :: PipelineExperimentConfig -> String
showsPrec :: Int -> PipelineExperimentConfig -> ShowS
$cshowsPrec :: Int -> PipelineExperimentConfig -> ShowS
Prelude.Show, forall x.
Rep PipelineExperimentConfig x -> PipelineExperimentConfig
forall x.
PipelineExperimentConfig -> Rep PipelineExperimentConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PipelineExperimentConfig x -> PipelineExperimentConfig
$cfrom :: forall x.
PipelineExperimentConfig -> Rep PipelineExperimentConfig x
Prelude.Generic)

-- |
-- Create a value of 'PipelineExperimentConfig' 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:
--
-- 'experimentName', 'pipelineExperimentConfig_experimentName' - The name of the experiment.
--
-- 'trialName', 'pipelineExperimentConfig_trialName' - The name of the trial.
newPipelineExperimentConfig ::
  PipelineExperimentConfig
newPipelineExperimentConfig :: PipelineExperimentConfig
newPipelineExperimentConfig =
  PipelineExperimentConfig'
    { $sel:experimentName:PipelineExperimentConfig' :: Maybe Text
experimentName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:trialName:PipelineExperimentConfig' :: Maybe Text
trialName = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the experiment.
pipelineExperimentConfig_experimentName :: Lens.Lens' PipelineExperimentConfig (Prelude.Maybe Prelude.Text)
pipelineExperimentConfig_experimentName :: Lens' PipelineExperimentConfig (Maybe Text)
pipelineExperimentConfig_experimentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineExperimentConfig' {Maybe Text
experimentName :: Maybe Text
$sel:experimentName:PipelineExperimentConfig' :: PipelineExperimentConfig -> Maybe Text
experimentName} -> Maybe Text
experimentName) (\s :: PipelineExperimentConfig
s@PipelineExperimentConfig' {} Maybe Text
a -> PipelineExperimentConfig
s {$sel:experimentName:PipelineExperimentConfig' :: Maybe Text
experimentName = Maybe Text
a} :: PipelineExperimentConfig)

-- | The name of the trial.
pipelineExperimentConfig_trialName :: Lens.Lens' PipelineExperimentConfig (Prelude.Maybe Prelude.Text)
pipelineExperimentConfig_trialName :: Lens' PipelineExperimentConfig (Maybe Text)
pipelineExperimentConfig_trialName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineExperimentConfig' {Maybe Text
trialName :: Maybe Text
$sel:trialName:PipelineExperimentConfig' :: PipelineExperimentConfig -> Maybe Text
trialName} -> Maybe Text
trialName) (\s :: PipelineExperimentConfig
s@PipelineExperimentConfig' {} Maybe Text
a -> PipelineExperimentConfig
s {$sel:trialName:PipelineExperimentConfig' :: Maybe Text
trialName = Maybe Text
a} :: PipelineExperimentConfig)

instance Data.FromJSON PipelineExperimentConfig where
  parseJSON :: Value -> Parser PipelineExperimentConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PipelineExperimentConfig"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> PipelineExperimentConfig
PipelineExperimentConfig'
            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
"ExperimentName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TrialName")
      )

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

instance Prelude.NFData PipelineExperimentConfig where
  rnf :: PipelineExperimentConfig -> ()
rnf PipelineExperimentConfig' {Maybe Text
trialName :: Maybe Text
experimentName :: Maybe Text
$sel:trialName:PipelineExperimentConfig' :: PipelineExperimentConfig -> Maybe Text
$sel:experimentName:PipelineExperimentConfig' :: PipelineExperimentConfig -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
experimentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
trialName