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

-- | A previously completed or stopped hyperparameter tuning job to be used
-- as a starting point for a new hyperparameter tuning job.
--
-- /See:/ 'newParentHyperParameterTuningJob' smart constructor.
data ParentHyperParameterTuningJob = ParentHyperParameterTuningJob'
  { -- | The name of the hyperparameter tuning job to be used as a starting point
    -- for a new hyperparameter tuning job.
    ParentHyperParameterTuningJob -> Maybe Text
hyperParameterTuningJobName :: Prelude.Maybe Prelude.Text
  }
  deriving (ParentHyperParameterTuningJob
-> ParentHyperParameterTuningJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParentHyperParameterTuningJob
-> ParentHyperParameterTuningJob -> Bool
$c/= :: ParentHyperParameterTuningJob
-> ParentHyperParameterTuningJob -> Bool
== :: ParentHyperParameterTuningJob
-> ParentHyperParameterTuningJob -> Bool
$c== :: ParentHyperParameterTuningJob
-> ParentHyperParameterTuningJob -> Bool
Prelude.Eq, ReadPrec [ParentHyperParameterTuningJob]
ReadPrec ParentHyperParameterTuningJob
Int -> ReadS ParentHyperParameterTuningJob
ReadS [ParentHyperParameterTuningJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParentHyperParameterTuningJob]
$creadListPrec :: ReadPrec [ParentHyperParameterTuningJob]
readPrec :: ReadPrec ParentHyperParameterTuningJob
$creadPrec :: ReadPrec ParentHyperParameterTuningJob
readList :: ReadS [ParentHyperParameterTuningJob]
$creadList :: ReadS [ParentHyperParameterTuningJob]
readsPrec :: Int -> ReadS ParentHyperParameterTuningJob
$creadsPrec :: Int -> ReadS ParentHyperParameterTuningJob
Prelude.Read, Int -> ParentHyperParameterTuningJob -> ShowS
[ParentHyperParameterTuningJob] -> ShowS
ParentHyperParameterTuningJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParentHyperParameterTuningJob] -> ShowS
$cshowList :: [ParentHyperParameterTuningJob] -> ShowS
show :: ParentHyperParameterTuningJob -> String
$cshow :: ParentHyperParameterTuningJob -> String
showsPrec :: Int -> ParentHyperParameterTuningJob -> ShowS
$cshowsPrec :: Int -> ParentHyperParameterTuningJob -> ShowS
Prelude.Show, forall x.
Rep ParentHyperParameterTuningJob x
-> ParentHyperParameterTuningJob
forall x.
ParentHyperParameterTuningJob
-> Rep ParentHyperParameterTuningJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ParentHyperParameterTuningJob x
-> ParentHyperParameterTuningJob
$cfrom :: forall x.
ParentHyperParameterTuningJob
-> Rep ParentHyperParameterTuningJob x
Prelude.Generic)

-- |
-- Create a value of 'ParentHyperParameterTuningJob' 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:
--
-- 'hyperParameterTuningJobName', 'parentHyperParameterTuningJob_hyperParameterTuningJobName' - The name of the hyperparameter tuning job to be used as a starting point
-- for a new hyperparameter tuning job.
newParentHyperParameterTuningJob ::
  ParentHyperParameterTuningJob
newParentHyperParameterTuningJob :: ParentHyperParameterTuningJob
newParentHyperParameterTuningJob =
  ParentHyperParameterTuningJob'
    { $sel:hyperParameterTuningJobName:ParentHyperParameterTuningJob' :: Maybe Text
hyperParameterTuningJobName =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the hyperparameter tuning job to be used as a starting point
-- for a new hyperparameter tuning job.
parentHyperParameterTuningJob_hyperParameterTuningJobName :: Lens.Lens' ParentHyperParameterTuningJob (Prelude.Maybe Prelude.Text)
parentHyperParameterTuningJob_hyperParameterTuningJobName :: Lens' ParentHyperParameterTuningJob (Maybe Text)
parentHyperParameterTuningJob_hyperParameterTuningJobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParentHyperParameterTuningJob' {Maybe Text
hyperParameterTuningJobName :: Maybe Text
$sel:hyperParameterTuningJobName:ParentHyperParameterTuningJob' :: ParentHyperParameterTuningJob -> Maybe Text
hyperParameterTuningJobName} -> Maybe Text
hyperParameterTuningJobName) (\s :: ParentHyperParameterTuningJob
s@ParentHyperParameterTuningJob' {} Maybe Text
a -> ParentHyperParameterTuningJob
s {$sel:hyperParameterTuningJobName:ParentHyperParameterTuningJob' :: Maybe Text
hyperParameterTuningJobName = Maybe Text
a} :: ParentHyperParameterTuningJob)

instance Data.FromJSON ParentHyperParameterTuningJob where
  parseJSON :: Value -> Parser ParentHyperParameterTuningJob
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ParentHyperParameterTuningJob"
      ( \Object
x ->
          Maybe Text -> ParentHyperParameterTuningJob
ParentHyperParameterTuningJob'
            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
"HyperParameterTuningJobName")
      )

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

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

instance Data.ToJSON ParentHyperParameterTuningJob where
  toJSON :: ParentHyperParameterTuningJob -> Value
toJSON ParentHyperParameterTuningJob' {Maybe Text
hyperParameterTuningJobName :: Maybe Text
$sel:hyperParameterTuningJobName:ParentHyperParameterTuningJob' :: ParentHyperParameterTuningJob -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"HyperParameterTuningJobName" 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
hyperParameterTuningJobName
          ]
      )