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

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

-- | Contains data, such as the inputs and targeted instance types that are
-- used in the process of validating the model package.
--
-- The data provided in the validation profile is made available to your
-- buyers on Amazon Web Services Marketplace.
--
-- /See:/ 'newModelPackageValidationProfile' smart constructor.
data ModelPackageValidationProfile = ModelPackageValidationProfile'
  { -- | The name of the profile for the model package.
    ModelPackageValidationProfile -> Text
profileName :: Prelude.Text,
    -- | The @TransformJobDefinition@ object that describes the transform job
    -- used for the validation of the model package.
    ModelPackageValidationProfile -> TransformJobDefinition
transformJobDefinition :: TransformJobDefinition
  }
  deriving (ModelPackageValidationProfile
-> ModelPackageValidationProfile -> Bool
(ModelPackageValidationProfile
 -> ModelPackageValidationProfile -> Bool)
-> (ModelPackageValidationProfile
    -> ModelPackageValidationProfile -> Bool)
-> Eq ModelPackageValidationProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelPackageValidationProfile
-> ModelPackageValidationProfile -> Bool
$c/= :: ModelPackageValidationProfile
-> ModelPackageValidationProfile -> Bool
== :: ModelPackageValidationProfile
-> ModelPackageValidationProfile -> Bool
$c== :: ModelPackageValidationProfile
-> ModelPackageValidationProfile -> Bool
Prelude.Eq, ReadPrec [ModelPackageValidationProfile]
ReadPrec ModelPackageValidationProfile
Int -> ReadS ModelPackageValidationProfile
ReadS [ModelPackageValidationProfile]
(Int -> ReadS ModelPackageValidationProfile)
-> ReadS [ModelPackageValidationProfile]
-> ReadPrec ModelPackageValidationProfile
-> ReadPrec [ModelPackageValidationProfile]
-> Read ModelPackageValidationProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelPackageValidationProfile]
$creadListPrec :: ReadPrec [ModelPackageValidationProfile]
readPrec :: ReadPrec ModelPackageValidationProfile
$creadPrec :: ReadPrec ModelPackageValidationProfile
readList :: ReadS [ModelPackageValidationProfile]
$creadList :: ReadS [ModelPackageValidationProfile]
readsPrec :: Int -> ReadS ModelPackageValidationProfile
$creadsPrec :: Int -> ReadS ModelPackageValidationProfile
Prelude.Read, Int -> ModelPackageValidationProfile -> ShowS
[ModelPackageValidationProfile] -> ShowS
ModelPackageValidationProfile -> String
(Int -> ModelPackageValidationProfile -> ShowS)
-> (ModelPackageValidationProfile -> String)
-> ([ModelPackageValidationProfile] -> ShowS)
-> Show ModelPackageValidationProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelPackageValidationProfile] -> ShowS
$cshowList :: [ModelPackageValidationProfile] -> ShowS
show :: ModelPackageValidationProfile -> String
$cshow :: ModelPackageValidationProfile -> String
showsPrec :: Int -> ModelPackageValidationProfile -> ShowS
$cshowsPrec :: Int -> ModelPackageValidationProfile -> ShowS
Prelude.Show, (forall x.
 ModelPackageValidationProfile
 -> Rep ModelPackageValidationProfile x)
-> (forall x.
    Rep ModelPackageValidationProfile x
    -> ModelPackageValidationProfile)
-> Generic ModelPackageValidationProfile
forall x.
Rep ModelPackageValidationProfile x
-> ModelPackageValidationProfile
forall x.
ModelPackageValidationProfile
-> Rep ModelPackageValidationProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModelPackageValidationProfile x
-> ModelPackageValidationProfile
$cfrom :: forall x.
ModelPackageValidationProfile
-> Rep ModelPackageValidationProfile x
Prelude.Generic)

-- |
-- Create a value of 'ModelPackageValidationProfile' 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:
--
-- 'profileName', 'modelPackageValidationProfile_profileName' - The name of the profile for the model package.
--
-- 'transformJobDefinition', 'modelPackageValidationProfile_transformJobDefinition' - The @TransformJobDefinition@ object that describes the transform job
-- used for the validation of the model package.
newModelPackageValidationProfile ::
  -- | 'profileName'
  Prelude.Text ->
  -- | 'transformJobDefinition'
  TransformJobDefinition ->
  ModelPackageValidationProfile
newModelPackageValidationProfile :: Text -> TransformJobDefinition -> ModelPackageValidationProfile
newModelPackageValidationProfile
  Text
pProfileName_
  TransformJobDefinition
pTransformJobDefinition_ =
    ModelPackageValidationProfile' :: Text -> TransformJobDefinition -> ModelPackageValidationProfile
ModelPackageValidationProfile'
      { $sel:profileName:ModelPackageValidationProfile' :: Text
profileName =
          Text
pProfileName_,
        $sel:transformJobDefinition:ModelPackageValidationProfile' :: TransformJobDefinition
transformJobDefinition =
          TransformJobDefinition
pTransformJobDefinition_
      }

-- | The name of the profile for the model package.
modelPackageValidationProfile_profileName :: Lens.Lens' ModelPackageValidationProfile Prelude.Text
modelPackageValidationProfile_profileName :: (Text -> f Text)
-> ModelPackageValidationProfile -> f ModelPackageValidationProfile
modelPackageValidationProfile_profileName = (ModelPackageValidationProfile -> Text)
-> (ModelPackageValidationProfile
    -> Text -> ModelPackageValidationProfile)
-> Lens
     ModelPackageValidationProfile
     ModelPackageValidationProfile
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelPackageValidationProfile' {Text
profileName :: Text
$sel:profileName:ModelPackageValidationProfile' :: ModelPackageValidationProfile -> Text
profileName} -> Text
profileName) (\s :: ModelPackageValidationProfile
s@ModelPackageValidationProfile' {} Text
a -> ModelPackageValidationProfile
s {$sel:profileName:ModelPackageValidationProfile' :: Text
profileName = Text
a} :: ModelPackageValidationProfile)

-- | The @TransformJobDefinition@ object that describes the transform job
-- used for the validation of the model package.
modelPackageValidationProfile_transformJobDefinition :: Lens.Lens' ModelPackageValidationProfile TransformJobDefinition
modelPackageValidationProfile_transformJobDefinition :: (TransformJobDefinition -> f TransformJobDefinition)
-> ModelPackageValidationProfile -> f ModelPackageValidationProfile
modelPackageValidationProfile_transformJobDefinition = (ModelPackageValidationProfile -> TransformJobDefinition)
-> (ModelPackageValidationProfile
    -> TransformJobDefinition -> ModelPackageValidationProfile)
-> Lens
     ModelPackageValidationProfile
     ModelPackageValidationProfile
     TransformJobDefinition
     TransformJobDefinition
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelPackageValidationProfile' {TransformJobDefinition
transformJobDefinition :: TransformJobDefinition
$sel:transformJobDefinition:ModelPackageValidationProfile' :: ModelPackageValidationProfile -> TransformJobDefinition
transformJobDefinition} -> TransformJobDefinition
transformJobDefinition) (\s :: ModelPackageValidationProfile
s@ModelPackageValidationProfile' {} TransformJobDefinition
a -> ModelPackageValidationProfile
s {$sel:transformJobDefinition:ModelPackageValidationProfile' :: TransformJobDefinition
transformJobDefinition = TransformJobDefinition
a} :: ModelPackageValidationProfile)

instance Core.FromJSON ModelPackageValidationProfile where
  parseJSON :: Value -> Parser ModelPackageValidationProfile
parseJSON =
    String
-> (Object -> Parser ModelPackageValidationProfile)
-> Value
-> Parser ModelPackageValidationProfile
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ModelPackageValidationProfile"
      ( \Object
x ->
          Text -> TransformJobDefinition -> ModelPackageValidationProfile
ModelPackageValidationProfile'
            (Text -> TransformJobDefinition -> ModelPackageValidationProfile)
-> Parser Text
-> Parser (TransformJobDefinition -> ModelPackageValidationProfile)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ProfileName")
            Parser (TransformJobDefinition -> ModelPackageValidationProfile)
-> Parser TransformJobDefinition
-> Parser ModelPackageValidationProfile
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TransformJobDefinition
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TransformJobDefinition")
      )

instance
  Prelude.Hashable
    ModelPackageValidationProfile

instance Prelude.NFData ModelPackageValidationProfile

instance Core.ToJSON ModelPackageValidationProfile where
  toJSON :: ModelPackageValidationProfile -> Value
toJSON ModelPackageValidationProfile' {Text
TransformJobDefinition
transformJobDefinition :: TransformJobDefinition
profileName :: Text
$sel:transformJobDefinition:ModelPackageValidationProfile' :: ModelPackageValidationProfile -> TransformJobDefinition
$sel:profileName:ModelPackageValidationProfile' :: ModelPackageValidationProfile -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ProfileName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
profileName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"TransformJobDefinition"
                  Text -> TransformJobDefinition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TransformJobDefinition
transformJobDefinition
              )
          ]
      )