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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.ModelPackageStatusItem

-- | Specifies the validation and image scan statuses of the model package.
--
-- /See:/ 'newModelPackageStatusDetails' smart constructor.
data ModelPackageStatusDetails = ModelPackageStatusDetails'
  { -- | The status of the scan of the Docker image container for the model
    -- package.
    ModelPackageStatusDetails -> Maybe [ModelPackageStatusItem]
imageScanStatuses :: Prelude.Maybe [ModelPackageStatusItem],
    -- | The validation status of the model package.
    ModelPackageStatusDetails -> [ModelPackageStatusItem]
validationStatuses :: [ModelPackageStatusItem]
  }
  deriving (ModelPackageStatusDetails -> ModelPackageStatusDetails -> Bool
(ModelPackageStatusDetails -> ModelPackageStatusDetails -> Bool)
-> (ModelPackageStatusDetails -> ModelPackageStatusDetails -> Bool)
-> Eq ModelPackageStatusDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelPackageStatusDetails -> ModelPackageStatusDetails -> Bool
$c/= :: ModelPackageStatusDetails -> ModelPackageStatusDetails -> Bool
== :: ModelPackageStatusDetails -> ModelPackageStatusDetails -> Bool
$c== :: ModelPackageStatusDetails -> ModelPackageStatusDetails -> Bool
Prelude.Eq, ReadPrec [ModelPackageStatusDetails]
ReadPrec ModelPackageStatusDetails
Int -> ReadS ModelPackageStatusDetails
ReadS [ModelPackageStatusDetails]
(Int -> ReadS ModelPackageStatusDetails)
-> ReadS [ModelPackageStatusDetails]
-> ReadPrec ModelPackageStatusDetails
-> ReadPrec [ModelPackageStatusDetails]
-> Read ModelPackageStatusDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelPackageStatusDetails]
$creadListPrec :: ReadPrec [ModelPackageStatusDetails]
readPrec :: ReadPrec ModelPackageStatusDetails
$creadPrec :: ReadPrec ModelPackageStatusDetails
readList :: ReadS [ModelPackageStatusDetails]
$creadList :: ReadS [ModelPackageStatusDetails]
readsPrec :: Int -> ReadS ModelPackageStatusDetails
$creadsPrec :: Int -> ReadS ModelPackageStatusDetails
Prelude.Read, Int -> ModelPackageStatusDetails -> ShowS
[ModelPackageStatusDetails] -> ShowS
ModelPackageStatusDetails -> String
(Int -> ModelPackageStatusDetails -> ShowS)
-> (ModelPackageStatusDetails -> String)
-> ([ModelPackageStatusDetails] -> ShowS)
-> Show ModelPackageStatusDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelPackageStatusDetails] -> ShowS
$cshowList :: [ModelPackageStatusDetails] -> ShowS
show :: ModelPackageStatusDetails -> String
$cshow :: ModelPackageStatusDetails -> String
showsPrec :: Int -> ModelPackageStatusDetails -> ShowS
$cshowsPrec :: Int -> ModelPackageStatusDetails -> ShowS
Prelude.Show, (forall x.
 ModelPackageStatusDetails -> Rep ModelPackageStatusDetails x)
-> (forall x.
    Rep ModelPackageStatusDetails x -> ModelPackageStatusDetails)
-> Generic ModelPackageStatusDetails
forall x.
Rep ModelPackageStatusDetails x -> ModelPackageStatusDetails
forall x.
ModelPackageStatusDetails -> Rep ModelPackageStatusDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModelPackageStatusDetails x -> ModelPackageStatusDetails
$cfrom :: forall x.
ModelPackageStatusDetails -> Rep ModelPackageStatusDetails x
Prelude.Generic)

-- |
-- Create a value of 'ModelPackageStatusDetails' 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:
--
-- 'imageScanStatuses', 'modelPackageStatusDetails_imageScanStatuses' - The status of the scan of the Docker image container for the model
-- package.
--
-- 'validationStatuses', 'modelPackageStatusDetails_validationStatuses' - The validation status of the model package.
newModelPackageStatusDetails ::
  ModelPackageStatusDetails
newModelPackageStatusDetails :: ModelPackageStatusDetails
newModelPackageStatusDetails =
  ModelPackageStatusDetails' :: Maybe [ModelPackageStatusItem]
-> [ModelPackageStatusItem] -> ModelPackageStatusDetails
ModelPackageStatusDetails'
    { $sel:imageScanStatuses:ModelPackageStatusDetails' :: Maybe [ModelPackageStatusItem]
imageScanStatuses =
        Maybe [ModelPackageStatusItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:validationStatuses:ModelPackageStatusDetails' :: [ModelPackageStatusItem]
validationStatuses = [ModelPackageStatusItem]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The status of the scan of the Docker image container for the model
-- package.
modelPackageStatusDetails_imageScanStatuses :: Lens.Lens' ModelPackageStatusDetails (Prelude.Maybe [ModelPackageStatusItem])
modelPackageStatusDetails_imageScanStatuses :: (Maybe [ModelPackageStatusItem]
 -> f (Maybe [ModelPackageStatusItem]))
-> ModelPackageStatusDetails -> f ModelPackageStatusDetails
modelPackageStatusDetails_imageScanStatuses = (ModelPackageStatusDetails -> Maybe [ModelPackageStatusItem])
-> (ModelPackageStatusDetails
    -> Maybe [ModelPackageStatusItem] -> ModelPackageStatusDetails)
-> Lens
     ModelPackageStatusDetails
     ModelPackageStatusDetails
     (Maybe [ModelPackageStatusItem])
     (Maybe [ModelPackageStatusItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelPackageStatusDetails' {Maybe [ModelPackageStatusItem]
imageScanStatuses :: Maybe [ModelPackageStatusItem]
$sel:imageScanStatuses:ModelPackageStatusDetails' :: ModelPackageStatusDetails -> Maybe [ModelPackageStatusItem]
imageScanStatuses} -> Maybe [ModelPackageStatusItem]
imageScanStatuses) (\s :: ModelPackageStatusDetails
s@ModelPackageStatusDetails' {} Maybe [ModelPackageStatusItem]
a -> ModelPackageStatusDetails
s {$sel:imageScanStatuses:ModelPackageStatusDetails' :: Maybe [ModelPackageStatusItem]
imageScanStatuses = Maybe [ModelPackageStatusItem]
a} :: ModelPackageStatusDetails) ((Maybe [ModelPackageStatusItem]
  -> f (Maybe [ModelPackageStatusItem]))
 -> ModelPackageStatusDetails -> f ModelPackageStatusDetails)
-> ((Maybe [ModelPackageStatusItem]
     -> f (Maybe [ModelPackageStatusItem]))
    -> Maybe [ModelPackageStatusItem]
    -> f (Maybe [ModelPackageStatusItem]))
-> (Maybe [ModelPackageStatusItem]
    -> f (Maybe [ModelPackageStatusItem]))
-> ModelPackageStatusDetails
-> f ModelPackageStatusDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ModelPackageStatusItem]
  [ModelPackageStatusItem]
  [ModelPackageStatusItem]
  [ModelPackageStatusItem]
-> Iso
     (Maybe [ModelPackageStatusItem])
     (Maybe [ModelPackageStatusItem])
     (Maybe [ModelPackageStatusItem])
     (Maybe [ModelPackageStatusItem])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ModelPackageStatusItem]
  [ModelPackageStatusItem]
  [ModelPackageStatusItem]
  [ModelPackageStatusItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The validation status of the model package.
modelPackageStatusDetails_validationStatuses :: Lens.Lens' ModelPackageStatusDetails [ModelPackageStatusItem]
modelPackageStatusDetails_validationStatuses :: ([ModelPackageStatusItem] -> f [ModelPackageStatusItem])
-> ModelPackageStatusDetails -> f ModelPackageStatusDetails
modelPackageStatusDetails_validationStatuses = (ModelPackageStatusDetails -> [ModelPackageStatusItem])
-> (ModelPackageStatusDetails
    -> [ModelPackageStatusItem] -> ModelPackageStatusDetails)
-> Lens
     ModelPackageStatusDetails
     ModelPackageStatusDetails
     [ModelPackageStatusItem]
     [ModelPackageStatusItem]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelPackageStatusDetails' {[ModelPackageStatusItem]
validationStatuses :: [ModelPackageStatusItem]
$sel:validationStatuses:ModelPackageStatusDetails' :: ModelPackageStatusDetails -> [ModelPackageStatusItem]
validationStatuses} -> [ModelPackageStatusItem]
validationStatuses) (\s :: ModelPackageStatusDetails
s@ModelPackageStatusDetails' {} [ModelPackageStatusItem]
a -> ModelPackageStatusDetails
s {$sel:validationStatuses:ModelPackageStatusDetails' :: [ModelPackageStatusItem]
validationStatuses = [ModelPackageStatusItem]
a} :: ModelPackageStatusDetails) (([ModelPackageStatusItem] -> f [ModelPackageStatusItem])
 -> ModelPackageStatusDetails -> f ModelPackageStatusDetails)
-> (([ModelPackageStatusItem] -> f [ModelPackageStatusItem])
    -> [ModelPackageStatusItem] -> f [ModelPackageStatusItem])
-> ([ModelPackageStatusItem] -> f [ModelPackageStatusItem])
-> ModelPackageStatusDetails
-> f ModelPackageStatusDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ModelPackageStatusItem] -> f [ModelPackageStatusItem])
-> [ModelPackageStatusItem] -> f [ModelPackageStatusItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON ModelPackageStatusDetails where
  parseJSON :: Value -> Parser ModelPackageStatusDetails
parseJSON =
    String
-> (Object -> Parser ModelPackageStatusDetails)
-> Value
-> Parser ModelPackageStatusDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ModelPackageStatusDetails"
      ( \Object
x ->
          Maybe [ModelPackageStatusItem]
-> [ModelPackageStatusItem] -> ModelPackageStatusDetails
ModelPackageStatusDetails'
            (Maybe [ModelPackageStatusItem]
 -> [ModelPackageStatusItem] -> ModelPackageStatusDetails)
-> Parser (Maybe [ModelPackageStatusItem])
-> Parser ([ModelPackageStatusItem] -> ModelPackageStatusDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ModelPackageStatusItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImageScanStatuses"
                            Parser (Maybe (Maybe [ModelPackageStatusItem]))
-> Maybe [ModelPackageStatusItem]
-> Parser (Maybe [ModelPackageStatusItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ModelPackageStatusItem]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser ([ModelPackageStatusItem] -> ModelPackageStatusDetails)
-> Parser [ModelPackageStatusItem]
-> Parser ModelPackageStatusDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [ModelPackageStatusItem])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ValidationStatuses"
                            Parser (Maybe [ModelPackageStatusItem])
-> [ModelPackageStatusItem] -> Parser [ModelPackageStatusItem]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [ModelPackageStatusItem]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ModelPackageStatusDetails

instance Prelude.NFData ModelPackageStatusDetails