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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details on the cache hit of a pipeline execution step.
--
-- /See:/ 'newCacheHitResult' smart constructor.
data CacheHitResult = CacheHitResult'
  { -- | The Amazon Resource Name (ARN) of the pipeline execution.
    CacheHitResult -> Maybe Text
sourcePipelineExecutionArn :: Prelude.Maybe Prelude.Text
  }
  deriving (CacheHitResult -> CacheHitResult -> Bool
(CacheHitResult -> CacheHitResult -> Bool)
-> (CacheHitResult -> CacheHitResult -> Bool) -> Eq CacheHitResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CacheHitResult -> CacheHitResult -> Bool
$c/= :: CacheHitResult -> CacheHitResult -> Bool
== :: CacheHitResult -> CacheHitResult -> Bool
$c== :: CacheHitResult -> CacheHitResult -> Bool
Prelude.Eq, ReadPrec [CacheHitResult]
ReadPrec CacheHitResult
Int -> ReadS CacheHitResult
ReadS [CacheHitResult]
(Int -> ReadS CacheHitResult)
-> ReadS [CacheHitResult]
-> ReadPrec CacheHitResult
-> ReadPrec [CacheHitResult]
-> Read CacheHitResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CacheHitResult]
$creadListPrec :: ReadPrec [CacheHitResult]
readPrec :: ReadPrec CacheHitResult
$creadPrec :: ReadPrec CacheHitResult
readList :: ReadS [CacheHitResult]
$creadList :: ReadS [CacheHitResult]
readsPrec :: Int -> ReadS CacheHitResult
$creadsPrec :: Int -> ReadS CacheHitResult
Prelude.Read, Int -> CacheHitResult -> ShowS
[CacheHitResult] -> ShowS
CacheHitResult -> String
(Int -> CacheHitResult -> ShowS)
-> (CacheHitResult -> String)
-> ([CacheHitResult] -> ShowS)
-> Show CacheHitResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CacheHitResult] -> ShowS
$cshowList :: [CacheHitResult] -> ShowS
show :: CacheHitResult -> String
$cshow :: CacheHitResult -> String
showsPrec :: Int -> CacheHitResult -> ShowS
$cshowsPrec :: Int -> CacheHitResult -> ShowS
Prelude.Show, (forall x. CacheHitResult -> Rep CacheHitResult x)
-> (forall x. Rep CacheHitResult x -> CacheHitResult)
-> Generic CacheHitResult
forall x. Rep CacheHitResult x -> CacheHitResult
forall x. CacheHitResult -> Rep CacheHitResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CacheHitResult x -> CacheHitResult
$cfrom :: forall x. CacheHitResult -> Rep CacheHitResult x
Prelude.Generic)

-- |
-- Create a value of 'CacheHitResult' 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:
--
-- 'sourcePipelineExecutionArn', 'cacheHitResult_sourcePipelineExecutionArn' - The Amazon Resource Name (ARN) of the pipeline execution.
newCacheHitResult ::
  CacheHitResult
newCacheHitResult :: CacheHitResult
newCacheHitResult =
  CacheHitResult' :: Maybe Text -> CacheHitResult
CacheHitResult'
    { $sel:sourcePipelineExecutionArn:CacheHitResult' :: Maybe Text
sourcePipelineExecutionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the pipeline execution.
cacheHitResult_sourcePipelineExecutionArn :: Lens.Lens' CacheHitResult (Prelude.Maybe Prelude.Text)
cacheHitResult_sourcePipelineExecutionArn :: (Maybe Text -> f (Maybe Text))
-> CacheHitResult -> f CacheHitResult
cacheHitResult_sourcePipelineExecutionArn = (CacheHitResult -> Maybe Text)
-> (CacheHitResult -> Maybe Text -> CacheHitResult)
-> Lens CacheHitResult CacheHitResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheHitResult' {Maybe Text
sourcePipelineExecutionArn :: Maybe Text
$sel:sourcePipelineExecutionArn:CacheHitResult' :: CacheHitResult -> Maybe Text
sourcePipelineExecutionArn} -> Maybe Text
sourcePipelineExecutionArn) (\s :: CacheHitResult
s@CacheHitResult' {} Maybe Text
a -> CacheHitResult
s {$sel:sourcePipelineExecutionArn:CacheHitResult' :: Maybe Text
sourcePipelineExecutionArn = Maybe Text
a} :: CacheHitResult)

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

instance Prelude.Hashable CacheHitResult

instance Prelude.NFData CacheHitResult