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

-- | Metadata for a training job step.
--
-- /See:/ 'newTrainingJobStepMetadata' smart constructor.
data TrainingJobStepMetadata = TrainingJobStepMetadata'
  { -- | The Amazon Resource Name (ARN) of the training job that was run by this
    -- step execution.
    TrainingJobStepMetadata -> Maybe Text
arn :: Prelude.Maybe Prelude.Text
  }
  deriving (TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
$c/= :: TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
== :: TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
$c== :: TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
Prelude.Eq, ReadPrec [TrainingJobStepMetadata]
ReadPrec TrainingJobStepMetadata
Int -> ReadS TrainingJobStepMetadata
ReadS [TrainingJobStepMetadata]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrainingJobStepMetadata]
$creadListPrec :: ReadPrec [TrainingJobStepMetadata]
readPrec :: ReadPrec TrainingJobStepMetadata
$creadPrec :: ReadPrec TrainingJobStepMetadata
readList :: ReadS [TrainingJobStepMetadata]
$creadList :: ReadS [TrainingJobStepMetadata]
readsPrec :: Int -> ReadS TrainingJobStepMetadata
$creadsPrec :: Int -> ReadS TrainingJobStepMetadata
Prelude.Read, Int -> TrainingJobStepMetadata -> ShowS
[TrainingJobStepMetadata] -> ShowS
TrainingJobStepMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrainingJobStepMetadata] -> ShowS
$cshowList :: [TrainingJobStepMetadata] -> ShowS
show :: TrainingJobStepMetadata -> String
$cshow :: TrainingJobStepMetadata -> String
showsPrec :: Int -> TrainingJobStepMetadata -> ShowS
$cshowsPrec :: Int -> TrainingJobStepMetadata -> ShowS
Prelude.Show, forall x. Rep TrainingJobStepMetadata x -> TrainingJobStepMetadata
forall x. TrainingJobStepMetadata -> Rep TrainingJobStepMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrainingJobStepMetadata x -> TrainingJobStepMetadata
$cfrom :: forall x. TrainingJobStepMetadata -> Rep TrainingJobStepMetadata x
Prelude.Generic)

-- |
-- Create a value of 'TrainingJobStepMetadata' 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:
--
-- 'arn', 'trainingJobStepMetadata_arn' - The Amazon Resource Name (ARN) of the training job that was run by this
-- step execution.
newTrainingJobStepMetadata ::
  TrainingJobStepMetadata
newTrainingJobStepMetadata :: TrainingJobStepMetadata
newTrainingJobStepMetadata =
  TrainingJobStepMetadata' {$sel:arn:TrainingJobStepMetadata' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing}

-- | The Amazon Resource Name (ARN) of the training job that was run by this
-- step execution.
trainingJobStepMetadata_arn :: Lens.Lens' TrainingJobStepMetadata (Prelude.Maybe Prelude.Text)
trainingJobStepMetadata_arn :: Lens' TrainingJobStepMetadata (Maybe Text)
trainingJobStepMetadata_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrainingJobStepMetadata' {Maybe Text
arn :: Maybe Text
$sel:arn:TrainingJobStepMetadata' :: TrainingJobStepMetadata -> Maybe Text
arn} -> Maybe Text
arn) (\s :: TrainingJobStepMetadata
s@TrainingJobStepMetadata' {} Maybe Text
a -> TrainingJobStepMetadata
s {$sel:arn:TrainingJobStepMetadata' :: Maybe Text
arn = Maybe Text
a} :: TrainingJobStepMetadata)

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

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

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