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

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

-- | Describes the Docker container for the model package.
--
-- /See:/ 'newModelPackageContainerDefinition' smart constructor.
data ModelPackageContainerDefinition = ModelPackageContainerDefinition'
  { -- | The Amazon S3 path where the model artifacts, which result from model
    -- training, are stored. This path must point to a single @gzip@ compressed
    -- tar archive (@.tar.gz@ suffix).
    --
    -- The model artifacts must be in an S3 bucket that is in the same region
    -- as the model package.
    ModelPackageContainerDefinition -> Maybe Text
modelDataUrl :: Prelude.Maybe Prelude.Text,
    -- | The environment variables to set in the Docker container. Each key and
    -- value in the @Environment@ string to string map can have length of up to
    -- 1024. We support up to 16 entries in the map.
    ModelPackageContainerDefinition -> Maybe (HashMap Text Text)
environment :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | An MD5 hash of the training algorithm that identifies the Docker image
    -- used for training.
    ModelPackageContainerDefinition -> Maybe Text
imageDigest :: Prelude.Maybe Prelude.Text,
    -- | The DNS host name for the Docker container.
    ModelPackageContainerDefinition -> Maybe Text
containerHostname :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Marketplace product ID of the model package.
    ModelPackageContainerDefinition -> Maybe Text
productId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon EC2 Container Registry (Amazon ECR) path where inference code
    -- is stored.
    --
    -- If you are using your own custom algorithm instead of an algorithm
    -- provided by Amazon SageMaker, the inference code must meet Amazon
    -- SageMaker requirements. Amazon SageMaker supports both
    -- @registry\/repository[:tag]@ and @registry\/repository[\@digest]@ image
    -- path formats. For more information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
    ModelPackageContainerDefinition -> Text
image :: Prelude.Text
  }
  deriving (ModelPackageContainerDefinition
-> ModelPackageContainerDefinition -> Bool
(ModelPackageContainerDefinition
 -> ModelPackageContainerDefinition -> Bool)
-> (ModelPackageContainerDefinition
    -> ModelPackageContainerDefinition -> Bool)
-> Eq ModelPackageContainerDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelPackageContainerDefinition
-> ModelPackageContainerDefinition -> Bool
$c/= :: ModelPackageContainerDefinition
-> ModelPackageContainerDefinition -> Bool
== :: ModelPackageContainerDefinition
-> ModelPackageContainerDefinition -> Bool
$c== :: ModelPackageContainerDefinition
-> ModelPackageContainerDefinition -> Bool
Prelude.Eq, ReadPrec [ModelPackageContainerDefinition]
ReadPrec ModelPackageContainerDefinition
Int -> ReadS ModelPackageContainerDefinition
ReadS [ModelPackageContainerDefinition]
(Int -> ReadS ModelPackageContainerDefinition)
-> ReadS [ModelPackageContainerDefinition]
-> ReadPrec ModelPackageContainerDefinition
-> ReadPrec [ModelPackageContainerDefinition]
-> Read ModelPackageContainerDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelPackageContainerDefinition]
$creadListPrec :: ReadPrec [ModelPackageContainerDefinition]
readPrec :: ReadPrec ModelPackageContainerDefinition
$creadPrec :: ReadPrec ModelPackageContainerDefinition
readList :: ReadS [ModelPackageContainerDefinition]
$creadList :: ReadS [ModelPackageContainerDefinition]
readsPrec :: Int -> ReadS ModelPackageContainerDefinition
$creadsPrec :: Int -> ReadS ModelPackageContainerDefinition
Prelude.Read, Int -> ModelPackageContainerDefinition -> ShowS
[ModelPackageContainerDefinition] -> ShowS
ModelPackageContainerDefinition -> String
(Int -> ModelPackageContainerDefinition -> ShowS)
-> (ModelPackageContainerDefinition -> String)
-> ([ModelPackageContainerDefinition] -> ShowS)
-> Show ModelPackageContainerDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelPackageContainerDefinition] -> ShowS
$cshowList :: [ModelPackageContainerDefinition] -> ShowS
show :: ModelPackageContainerDefinition -> String
$cshow :: ModelPackageContainerDefinition -> String
showsPrec :: Int -> ModelPackageContainerDefinition -> ShowS
$cshowsPrec :: Int -> ModelPackageContainerDefinition -> ShowS
Prelude.Show, (forall x.
 ModelPackageContainerDefinition
 -> Rep ModelPackageContainerDefinition x)
-> (forall x.
    Rep ModelPackageContainerDefinition x
    -> ModelPackageContainerDefinition)
-> Generic ModelPackageContainerDefinition
forall x.
Rep ModelPackageContainerDefinition x
-> ModelPackageContainerDefinition
forall x.
ModelPackageContainerDefinition
-> Rep ModelPackageContainerDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModelPackageContainerDefinition x
-> ModelPackageContainerDefinition
$cfrom :: forall x.
ModelPackageContainerDefinition
-> Rep ModelPackageContainerDefinition x
Prelude.Generic)

-- |
-- Create a value of 'ModelPackageContainerDefinition' 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:
--
-- 'modelDataUrl', 'modelPackageContainerDefinition_modelDataUrl' - The Amazon S3 path where the model artifacts, which result from model
-- training, are stored. This path must point to a single @gzip@ compressed
-- tar archive (@.tar.gz@ suffix).
--
-- The model artifacts must be in an S3 bucket that is in the same region
-- as the model package.
--
-- 'environment', 'modelPackageContainerDefinition_environment' - The environment variables to set in the Docker container. Each key and
-- value in the @Environment@ string to string map can have length of up to
-- 1024. We support up to 16 entries in the map.
--
-- 'imageDigest', 'modelPackageContainerDefinition_imageDigest' - An MD5 hash of the training algorithm that identifies the Docker image
-- used for training.
--
-- 'containerHostname', 'modelPackageContainerDefinition_containerHostname' - The DNS host name for the Docker container.
--
-- 'productId', 'modelPackageContainerDefinition_productId' - The Amazon Web Services Marketplace product ID of the model package.
--
-- 'image', 'modelPackageContainerDefinition_image' - The Amazon EC2 Container Registry (Amazon ECR) path where inference code
-- is stored.
--
-- If you are using your own custom algorithm instead of an algorithm
-- provided by Amazon SageMaker, the inference code must meet Amazon
-- SageMaker requirements. Amazon SageMaker supports both
-- @registry\/repository[:tag]@ and @registry\/repository[\@digest]@ image
-- path formats. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
newModelPackageContainerDefinition ::
  -- | 'image'
  Prelude.Text ->
  ModelPackageContainerDefinition
newModelPackageContainerDefinition :: Text -> ModelPackageContainerDefinition
newModelPackageContainerDefinition Text
pImage_ =
  ModelPackageContainerDefinition' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> ModelPackageContainerDefinition
ModelPackageContainerDefinition'
    { $sel:modelDataUrl:ModelPackageContainerDefinition' :: Maybe Text
modelDataUrl =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environment:ModelPackageContainerDefinition' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:imageDigest:ModelPackageContainerDefinition' :: Maybe Text
imageDigest = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:containerHostname:ModelPackageContainerDefinition' :: Maybe Text
containerHostname = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:productId:ModelPackageContainerDefinition' :: Maybe Text
productId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:image:ModelPackageContainerDefinition' :: Text
image = Text
pImage_
    }

-- | The Amazon S3 path where the model artifacts, which result from model
-- training, are stored. This path must point to a single @gzip@ compressed
-- tar archive (@.tar.gz@ suffix).
--
-- The model artifacts must be in an S3 bucket that is in the same region
-- as the model package.
modelPackageContainerDefinition_modelDataUrl :: Lens.Lens' ModelPackageContainerDefinition (Prelude.Maybe Prelude.Text)
modelPackageContainerDefinition_modelDataUrl :: (Maybe Text -> f (Maybe Text))
-> ModelPackageContainerDefinition
-> f ModelPackageContainerDefinition
modelPackageContainerDefinition_modelDataUrl = (ModelPackageContainerDefinition -> Maybe Text)
-> (ModelPackageContainerDefinition
    -> Maybe Text -> ModelPackageContainerDefinition)
-> Lens
     ModelPackageContainerDefinition
     ModelPackageContainerDefinition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelPackageContainerDefinition' {Maybe Text
modelDataUrl :: Maybe Text
$sel:modelDataUrl:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe Text
modelDataUrl} -> Maybe Text
modelDataUrl) (\s :: ModelPackageContainerDefinition
s@ModelPackageContainerDefinition' {} Maybe Text
a -> ModelPackageContainerDefinition
s {$sel:modelDataUrl:ModelPackageContainerDefinition' :: Maybe Text
modelDataUrl = Maybe Text
a} :: ModelPackageContainerDefinition)

-- | The environment variables to set in the Docker container. Each key and
-- value in the @Environment@ string to string map can have length of up to
-- 1024. We support up to 16 entries in the map.
modelPackageContainerDefinition_environment :: Lens.Lens' ModelPackageContainerDefinition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
modelPackageContainerDefinition_environment :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ModelPackageContainerDefinition
-> f ModelPackageContainerDefinition
modelPackageContainerDefinition_environment = (ModelPackageContainerDefinition -> Maybe (HashMap Text Text))
-> (ModelPackageContainerDefinition
    -> Maybe (HashMap Text Text) -> ModelPackageContainerDefinition)
-> Lens
     ModelPackageContainerDefinition
     ModelPackageContainerDefinition
     (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 (\ModelPackageContainerDefinition' {Maybe (HashMap Text Text)
environment :: Maybe (HashMap Text Text)
$sel:environment:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe (HashMap Text Text)
environment} -> Maybe (HashMap Text Text)
environment) (\s :: ModelPackageContainerDefinition
s@ModelPackageContainerDefinition' {} Maybe (HashMap Text Text)
a -> ModelPackageContainerDefinition
s {$sel:environment:ModelPackageContainerDefinition' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
a} :: ModelPackageContainerDefinition) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ModelPackageContainerDefinition
 -> f ModelPackageContainerDefinition)
-> ((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)))
-> ModelPackageContainerDefinition
-> f ModelPackageContainerDefinition
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

-- | An MD5 hash of the training algorithm that identifies the Docker image
-- used for training.
modelPackageContainerDefinition_imageDigest :: Lens.Lens' ModelPackageContainerDefinition (Prelude.Maybe Prelude.Text)
modelPackageContainerDefinition_imageDigest :: (Maybe Text -> f (Maybe Text))
-> ModelPackageContainerDefinition
-> f ModelPackageContainerDefinition
modelPackageContainerDefinition_imageDigest = (ModelPackageContainerDefinition -> Maybe Text)
-> (ModelPackageContainerDefinition
    -> Maybe Text -> ModelPackageContainerDefinition)
-> Lens
     ModelPackageContainerDefinition
     ModelPackageContainerDefinition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelPackageContainerDefinition' {Maybe Text
imageDigest :: Maybe Text
$sel:imageDigest:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe Text
imageDigest} -> Maybe Text
imageDigest) (\s :: ModelPackageContainerDefinition
s@ModelPackageContainerDefinition' {} Maybe Text
a -> ModelPackageContainerDefinition
s {$sel:imageDigest:ModelPackageContainerDefinition' :: Maybe Text
imageDigest = Maybe Text
a} :: ModelPackageContainerDefinition)

-- | The DNS host name for the Docker container.
modelPackageContainerDefinition_containerHostname :: Lens.Lens' ModelPackageContainerDefinition (Prelude.Maybe Prelude.Text)
modelPackageContainerDefinition_containerHostname :: (Maybe Text -> f (Maybe Text))
-> ModelPackageContainerDefinition
-> f ModelPackageContainerDefinition
modelPackageContainerDefinition_containerHostname = (ModelPackageContainerDefinition -> Maybe Text)
-> (ModelPackageContainerDefinition
    -> Maybe Text -> ModelPackageContainerDefinition)
-> Lens
     ModelPackageContainerDefinition
     ModelPackageContainerDefinition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelPackageContainerDefinition' {Maybe Text
containerHostname :: Maybe Text
$sel:containerHostname:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe Text
containerHostname} -> Maybe Text
containerHostname) (\s :: ModelPackageContainerDefinition
s@ModelPackageContainerDefinition' {} Maybe Text
a -> ModelPackageContainerDefinition
s {$sel:containerHostname:ModelPackageContainerDefinition' :: Maybe Text
containerHostname = Maybe Text
a} :: ModelPackageContainerDefinition)

-- | The Amazon Web Services Marketplace product ID of the model package.
modelPackageContainerDefinition_productId :: Lens.Lens' ModelPackageContainerDefinition (Prelude.Maybe Prelude.Text)
modelPackageContainerDefinition_productId :: (Maybe Text -> f (Maybe Text))
-> ModelPackageContainerDefinition
-> f ModelPackageContainerDefinition
modelPackageContainerDefinition_productId = (ModelPackageContainerDefinition -> Maybe Text)
-> (ModelPackageContainerDefinition
    -> Maybe Text -> ModelPackageContainerDefinition)
-> Lens
     ModelPackageContainerDefinition
     ModelPackageContainerDefinition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelPackageContainerDefinition' {Maybe Text
productId :: Maybe Text
$sel:productId:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe Text
productId} -> Maybe Text
productId) (\s :: ModelPackageContainerDefinition
s@ModelPackageContainerDefinition' {} Maybe Text
a -> ModelPackageContainerDefinition
s {$sel:productId:ModelPackageContainerDefinition' :: Maybe Text
productId = Maybe Text
a} :: ModelPackageContainerDefinition)

-- | The Amazon EC2 Container Registry (Amazon ECR) path where inference code
-- is stored.
--
-- If you are using your own custom algorithm instead of an algorithm
-- provided by Amazon SageMaker, the inference code must meet Amazon
-- SageMaker requirements. Amazon SageMaker supports both
-- @registry\/repository[:tag]@ and @registry\/repository[\@digest]@ image
-- path formats. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
modelPackageContainerDefinition_image :: Lens.Lens' ModelPackageContainerDefinition Prelude.Text
modelPackageContainerDefinition_image :: (Text -> f Text)
-> ModelPackageContainerDefinition
-> f ModelPackageContainerDefinition
modelPackageContainerDefinition_image = (ModelPackageContainerDefinition -> Text)
-> (ModelPackageContainerDefinition
    -> Text -> ModelPackageContainerDefinition)
-> Lens
     ModelPackageContainerDefinition
     ModelPackageContainerDefinition
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelPackageContainerDefinition' {Text
image :: Text
$sel:image:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Text
image} -> Text
image) (\s :: ModelPackageContainerDefinition
s@ModelPackageContainerDefinition' {} Text
a -> ModelPackageContainerDefinition
s {$sel:image:ModelPackageContainerDefinition' :: Text
image = Text
a} :: ModelPackageContainerDefinition)

instance
  Core.FromJSON
    ModelPackageContainerDefinition
  where
  parseJSON :: Value -> Parser ModelPackageContainerDefinition
parseJSON =
    String
-> (Object -> Parser ModelPackageContainerDefinition)
-> Value
-> Parser ModelPackageContainerDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ModelPackageContainerDefinition"
      ( \Object
x ->
          Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> ModelPackageContainerDefinition
ModelPackageContainerDefinition'
            (Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Text
 -> ModelPackageContainerDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> ModelPackageContainerDefinition)
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
"ModelDataUrl")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> ModelPackageContainerDefinition)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> ModelPackageContainerDefinition)
forall (f :: * -> *) a b. Applicative f => 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
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> ModelPackageContainerDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Text -> ModelPackageContainerDefinition)
forall (f :: * -> *) a b. Applicative f => 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
"ImageDigest")
            Parser
  (Maybe Text
   -> Maybe Text -> Text -> ModelPackageContainerDefinition)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> ModelPackageContainerDefinition)
forall (f :: * -> *) a b. Applicative f => 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
"ContainerHostname")
            Parser (Maybe Text -> Text -> ModelPackageContainerDefinition)
-> Parser (Maybe Text)
-> Parser (Text -> ModelPackageContainerDefinition)
forall (f :: * -> *) a b. Applicative f => 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
"ProductId")
            Parser (Text -> ModelPackageContainerDefinition)
-> Parser Text -> Parser ModelPackageContainerDefinition
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")
      )

instance
  Prelude.Hashable
    ModelPackageContainerDefinition

instance
  Prelude.NFData
    ModelPackageContainerDefinition

instance Core.ToJSON ModelPackageContainerDefinition where
  toJSON :: ModelPackageContainerDefinition -> Value
toJSON ModelPackageContainerDefinition' {Maybe Text
Maybe (HashMap Text Text)
Text
image :: Text
productId :: Maybe Text
containerHostname :: Maybe Text
imageDigest :: Maybe Text
environment :: Maybe (HashMap Text Text)
modelDataUrl :: Maybe Text
$sel:image:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Text
$sel:productId:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe Text
$sel:containerHostname:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe Text
$sel:imageDigest:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe Text
$sel:environment:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe (HashMap Text Text)
$sel:modelDataUrl:ModelPackageContainerDefinition' :: ModelPackageContainerDefinition -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ModelDataUrl" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
modelDataUrl,
            (Text
"Environment" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
environment,
            (Text
"ImageDigest" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
imageDigest,
            (Text
"ContainerHostname" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
containerHostname,
            (Text
"ProductId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
productId,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Image" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
image)
          ]
      )