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

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

-- | Provides information to verify the integrity of stored model artifacts.
--
-- /See:/ 'newModelDigests' smart constructor.
data ModelDigests = ModelDigests'
  { -- | Provides a hash value that uniquely identifies the stored model
    -- artifacts.
    ModelDigests -> Maybe Text
artifactDigest :: Prelude.Maybe Prelude.Text
  }
  deriving (ModelDigests -> ModelDigests -> Bool
(ModelDigests -> ModelDigests -> Bool)
-> (ModelDigests -> ModelDigests -> Bool) -> Eq ModelDigests
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelDigests -> ModelDigests -> Bool
$c/= :: ModelDigests -> ModelDigests -> Bool
== :: ModelDigests -> ModelDigests -> Bool
$c== :: ModelDigests -> ModelDigests -> Bool
Prelude.Eq, ReadPrec [ModelDigests]
ReadPrec ModelDigests
Int -> ReadS ModelDigests
ReadS [ModelDigests]
(Int -> ReadS ModelDigests)
-> ReadS [ModelDigests]
-> ReadPrec ModelDigests
-> ReadPrec [ModelDigests]
-> Read ModelDigests
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelDigests]
$creadListPrec :: ReadPrec [ModelDigests]
readPrec :: ReadPrec ModelDigests
$creadPrec :: ReadPrec ModelDigests
readList :: ReadS [ModelDigests]
$creadList :: ReadS [ModelDigests]
readsPrec :: Int -> ReadS ModelDigests
$creadsPrec :: Int -> ReadS ModelDigests
Prelude.Read, Int -> ModelDigests -> ShowS
[ModelDigests] -> ShowS
ModelDigests -> String
(Int -> ModelDigests -> ShowS)
-> (ModelDigests -> String)
-> ([ModelDigests] -> ShowS)
-> Show ModelDigests
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelDigests] -> ShowS
$cshowList :: [ModelDigests] -> ShowS
show :: ModelDigests -> String
$cshow :: ModelDigests -> String
showsPrec :: Int -> ModelDigests -> ShowS
$cshowsPrec :: Int -> ModelDigests -> ShowS
Prelude.Show, (forall x. ModelDigests -> Rep ModelDigests x)
-> (forall x. Rep ModelDigests x -> ModelDigests)
-> Generic ModelDigests
forall x. Rep ModelDigests x -> ModelDigests
forall x. ModelDigests -> Rep ModelDigests x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelDigests x -> ModelDigests
$cfrom :: forall x. ModelDigests -> Rep ModelDigests x
Prelude.Generic)

-- |
-- Create a value of 'ModelDigests' 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:
--
-- 'artifactDigest', 'modelDigests_artifactDigest' - Provides a hash value that uniquely identifies the stored model
-- artifacts.
newModelDigests ::
  ModelDigests
newModelDigests :: ModelDigests
newModelDigests =
  ModelDigests' :: Maybe Text -> ModelDigests
ModelDigests' {$sel:artifactDigest:ModelDigests' :: Maybe Text
artifactDigest = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | Provides a hash value that uniquely identifies the stored model
-- artifacts.
modelDigests_artifactDigest :: Lens.Lens' ModelDigests (Prelude.Maybe Prelude.Text)
modelDigests_artifactDigest :: (Maybe Text -> f (Maybe Text)) -> ModelDigests -> f ModelDigests
modelDigests_artifactDigest = (ModelDigests -> Maybe Text)
-> (ModelDigests -> Maybe Text -> ModelDigests)
-> Lens ModelDigests ModelDigests (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelDigests' {Maybe Text
artifactDigest :: Maybe Text
$sel:artifactDigest:ModelDigests' :: ModelDigests -> Maybe Text
artifactDigest} -> Maybe Text
artifactDigest) (\s :: ModelDigests
s@ModelDigests' {} Maybe Text
a -> ModelDigests
s {$sel:artifactDigest:ModelDigests' :: Maybe Text
artifactDigest = Maybe Text
a} :: ModelDigests)

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

instance Prelude.Hashable ModelDigests

instance Prelude.NFData ModelDigests