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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(ParentHyperParameterTuningJob
 -> ParentHyperParameterTuningJob -> Bool)
-> (ParentHyperParameterTuningJob
    -> ParentHyperParameterTuningJob -> Bool)
-> Eq ParentHyperParameterTuningJob
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]
(Int -> ReadS ParentHyperParameterTuningJob)
-> ReadS [ParentHyperParameterTuningJob]
-> ReadPrec ParentHyperParameterTuningJob
-> ReadPrec [ParentHyperParameterTuningJob]
-> Read 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
(Int -> ParentHyperParameterTuningJob -> ShowS)
-> (ParentHyperParameterTuningJob -> String)
-> ([ParentHyperParameterTuningJob] -> ShowS)
-> Show ParentHyperParameterTuningJob
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.
 ParentHyperParameterTuningJob
 -> Rep ParentHyperParameterTuningJob x)
-> (forall x.
    Rep ParentHyperParameterTuningJob x
    -> ParentHyperParameterTuningJob)
-> Generic ParentHyperParameterTuningJob
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' :: Maybe Text -> ParentHyperParameterTuningJob
ParentHyperParameterTuningJob'
    { $sel:hyperParameterTuningJobName:ParentHyperParameterTuningJob' :: Maybe Text
hyperParameterTuningJobName =
        Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> ParentHyperParameterTuningJob -> f ParentHyperParameterTuningJob
parentHyperParameterTuningJob_hyperParameterTuningJobName = (ParentHyperParameterTuningJob -> Maybe Text)
-> (ParentHyperParameterTuningJob
    -> Maybe Text -> ParentHyperParameterTuningJob)
-> Lens
     ParentHyperParameterTuningJob
     ParentHyperParameterTuningJob
     (Maybe Text)
     (Maybe Text)
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 Core.FromJSON ParentHyperParameterTuningJob where
  parseJSON :: Value -> Parser ParentHyperParameterTuningJob
parseJSON =
    String
-> (Object -> Parser ParentHyperParameterTuningJob)
-> Value
-> Parser ParentHyperParameterTuningJob
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ParentHyperParameterTuningJob"
      ( \Object
x ->
          Maybe Text -> ParentHyperParameterTuningJob
ParentHyperParameterTuningJob'
            (Maybe Text -> ParentHyperParameterTuningJob)
-> Parser (Maybe Text) -> Parser ParentHyperParameterTuningJob
forall (f :: * -> *) a b. Functor 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
"HyperParameterTuningJobName")
      )

instance
  Prelude.Hashable
    ParentHyperParameterTuningJob

instance Prelude.NFData ParentHyperParameterTuningJob

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