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

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

-- | A list of container definitions that describe the different containers
-- that make up an AutoML candidate. For more information, see .
--
-- /See:/ 'newAutoMLContainerDefinition' smart constructor.
data AutoMLContainerDefinition = AutoMLContainerDefinition'
  { -- | The environment variables to set in the container. For more information,
    -- see .
    AutoMLContainerDefinition -> Maybe (HashMap Text Text)
environment :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Elastic Container Registry (Amazon ECR) path of the
    -- container. For more information, see .
    AutoMLContainerDefinition -> Text
image :: Prelude.Text,
    -- | The location of the model artifacts. For more information, see .
    AutoMLContainerDefinition -> Text
modelDataUrl :: Prelude.Text
  }
  deriving (AutoMLContainerDefinition -> AutoMLContainerDefinition -> Bool
(AutoMLContainerDefinition -> AutoMLContainerDefinition -> Bool)
-> (AutoMLContainerDefinition -> AutoMLContainerDefinition -> Bool)
-> Eq AutoMLContainerDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoMLContainerDefinition -> AutoMLContainerDefinition -> Bool
$c/= :: AutoMLContainerDefinition -> AutoMLContainerDefinition -> Bool
== :: AutoMLContainerDefinition -> AutoMLContainerDefinition -> Bool
$c== :: AutoMLContainerDefinition -> AutoMLContainerDefinition -> Bool
Prelude.Eq, ReadPrec [AutoMLContainerDefinition]
ReadPrec AutoMLContainerDefinition
Int -> ReadS AutoMLContainerDefinition
ReadS [AutoMLContainerDefinition]
(Int -> ReadS AutoMLContainerDefinition)
-> ReadS [AutoMLContainerDefinition]
-> ReadPrec AutoMLContainerDefinition
-> ReadPrec [AutoMLContainerDefinition]
-> Read AutoMLContainerDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoMLContainerDefinition]
$creadListPrec :: ReadPrec [AutoMLContainerDefinition]
readPrec :: ReadPrec AutoMLContainerDefinition
$creadPrec :: ReadPrec AutoMLContainerDefinition
readList :: ReadS [AutoMLContainerDefinition]
$creadList :: ReadS [AutoMLContainerDefinition]
readsPrec :: Int -> ReadS AutoMLContainerDefinition
$creadsPrec :: Int -> ReadS AutoMLContainerDefinition
Prelude.Read, Int -> AutoMLContainerDefinition -> ShowS
[AutoMLContainerDefinition] -> ShowS
AutoMLContainerDefinition -> String
(Int -> AutoMLContainerDefinition -> ShowS)
-> (AutoMLContainerDefinition -> String)
-> ([AutoMLContainerDefinition] -> ShowS)
-> Show AutoMLContainerDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoMLContainerDefinition] -> ShowS
$cshowList :: [AutoMLContainerDefinition] -> ShowS
show :: AutoMLContainerDefinition -> String
$cshow :: AutoMLContainerDefinition -> String
showsPrec :: Int -> AutoMLContainerDefinition -> ShowS
$cshowsPrec :: Int -> AutoMLContainerDefinition -> ShowS
Prelude.Show, (forall x.
 AutoMLContainerDefinition -> Rep AutoMLContainerDefinition x)
-> (forall x.
    Rep AutoMLContainerDefinition x -> AutoMLContainerDefinition)
-> Generic AutoMLContainerDefinition
forall x.
Rep AutoMLContainerDefinition x -> AutoMLContainerDefinition
forall x.
AutoMLContainerDefinition -> Rep AutoMLContainerDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoMLContainerDefinition x -> AutoMLContainerDefinition
$cfrom :: forall x.
AutoMLContainerDefinition -> Rep AutoMLContainerDefinition x
Prelude.Generic)

-- |
-- Create a value of 'AutoMLContainerDefinition' 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:
--
-- 'environment', 'autoMLContainerDefinition_environment' - The environment variables to set in the container. For more information,
-- see .
--
-- 'image', 'autoMLContainerDefinition_image' - The Amazon Elastic Container Registry (Amazon ECR) path of the
-- container. For more information, see .
--
-- 'modelDataUrl', 'autoMLContainerDefinition_modelDataUrl' - The location of the model artifacts. For more information, see .
newAutoMLContainerDefinition ::
  -- | 'image'
  Prelude.Text ->
  -- | 'modelDataUrl'
  Prelude.Text ->
  AutoMLContainerDefinition
newAutoMLContainerDefinition :: Text -> Text -> AutoMLContainerDefinition
newAutoMLContainerDefinition Text
pImage_ Text
pModelDataUrl_ =
  AutoMLContainerDefinition' :: Maybe (HashMap Text Text)
-> Text -> Text -> AutoMLContainerDefinition
AutoMLContainerDefinition'
    { $sel:environment:AutoMLContainerDefinition' :: Maybe (HashMap Text Text)
environment =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:image:AutoMLContainerDefinition' :: Text
image = Text
pImage_,
      $sel:modelDataUrl:AutoMLContainerDefinition' :: Text
modelDataUrl = Text
pModelDataUrl_
    }

-- | The environment variables to set in the container. For more information,
-- see .
autoMLContainerDefinition_environment :: Lens.Lens' AutoMLContainerDefinition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
autoMLContainerDefinition_environment :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AutoMLContainerDefinition -> f AutoMLContainerDefinition
autoMLContainerDefinition_environment = (AutoMLContainerDefinition -> Maybe (HashMap Text Text))
-> (AutoMLContainerDefinition
    -> Maybe (HashMap Text Text) -> AutoMLContainerDefinition)
-> Lens
     AutoMLContainerDefinition
     AutoMLContainerDefinition
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLContainerDefinition' {Maybe (HashMap Text Text)
environment :: Maybe (HashMap Text Text)
$sel:environment:AutoMLContainerDefinition' :: AutoMLContainerDefinition -> Maybe (HashMap Text Text)
environment} -> Maybe (HashMap Text Text)
environment) (\s :: AutoMLContainerDefinition
s@AutoMLContainerDefinition' {} Maybe (HashMap Text Text)
a -> AutoMLContainerDefinition
s {$sel:environment:AutoMLContainerDefinition' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
a} :: AutoMLContainerDefinition) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AutoMLContainerDefinition -> f AutoMLContainerDefinition)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AutoMLContainerDefinition
-> f AutoMLContainerDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Elastic Container Registry (Amazon ECR) path of the
-- container. For more information, see .
autoMLContainerDefinition_image :: Lens.Lens' AutoMLContainerDefinition Prelude.Text
autoMLContainerDefinition_image :: (Text -> f Text)
-> AutoMLContainerDefinition -> f AutoMLContainerDefinition
autoMLContainerDefinition_image = (AutoMLContainerDefinition -> Text)
-> (AutoMLContainerDefinition -> Text -> AutoMLContainerDefinition)
-> Lens
     AutoMLContainerDefinition AutoMLContainerDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLContainerDefinition' {Text
image :: Text
$sel:image:AutoMLContainerDefinition' :: AutoMLContainerDefinition -> Text
image} -> Text
image) (\s :: AutoMLContainerDefinition
s@AutoMLContainerDefinition' {} Text
a -> AutoMLContainerDefinition
s {$sel:image:AutoMLContainerDefinition' :: Text
image = Text
a} :: AutoMLContainerDefinition)

-- | The location of the model artifacts. For more information, see .
autoMLContainerDefinition_modelDataUrl :: Lens.Lens' AutoMLContainerDefinition Prelude.Text
autoMLContainerDefinition_modelDataUrl :: (Text -> f Text)
-> AutoMLContainerDefinition -> f AutoMLContainerDefinition
autoMLContainerDefinition_modelDataUrl = (AutoMLContainerDefinition -> Text)
-> (AutoMLContainerDefinition -> Text -> AutoMLContainerDefinition)
-> Lens
     AutoMLContainerDefinition AutoMLContainerDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLContainerDefinition' {Text
modelDataUrl :: Text
$sel:modelDataUrl:AutoMLContainerDefinition' :: AutoMLContainerDefinition -> Text
modelDataUrl} -> Text
modelDataUrl) (\s :: AutoMLContainerDefinition
s@AutoMLContainerDefinition' {} Text
a -> AutoMLContainerDefinition
s {$sel:modelDataUrl:AutoMLContainerDefinition' :: Text
modelDataUrl = Text
a} :: AutoMLContainerDefinition)

instance Core.FromJSON AutoMLContainerDefinition where
  parseJSON :: Value -> Parser AutoMLContainerDefinition
parseJSON =
    String
-> (Object -> Parser AutoMLContainerDefinition)
-> Value
-> Parser AutoMLContainerDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AutoMLContainerDefinition"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Text -> Text -> AutoMLContainerDefinition
AutoMLContainerDefinition'
            (Maybe (HashMap Text Text)
 -> Text -> Text -> AutoMLContainerDefinition)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> Text -> AutoMLContainerDefinition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Environment" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser (Text -> Text -> AutoMLContainerDefinition)
-> Parser Text -> Parser (Text -> AutoMLContainerDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Image")
            Parser (Text -> AutoMLContainerDefinition)
-> Parser Text -> Parser AutoMLContainerDefinition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ModelDataUrl")
      )

instance Prelude.Hashable AutoMLContainerDefinition

instance Prelude.NFData AutoMLContainerDefinition