{-# 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.ContainerDefinition
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.ContainerDefinition where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.ContainerMode
import Amazonka.SageMaker.Types.ImageConfig
import Amazonka.SageMaker.Types.MultiModelConfig

-- | Describes the container, as part of model definition.
--
-- /See:/ 'newContainerDefinition' smart constructor.
data ContainerDefinition = ContainerDefinition'
  { -- | This parameter is ignored for models that contain only a
    -- @PrimaryContainer@.
    --
    -- When a @ContainerDefinition@ is part of an inference pipeline, the value
    -- of the parameter uniquely identifies the container for the purposes of
    -- logging and metrics. For information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/inference-pipeline-logs-metrics.html Use Logs and Metrics to Monitor an Inference Pipeline>.
    -- If you don\'t specify a value for this parameter for a
    -- @ContainerDefinition@ that is part of an inference pipeline, a unique
    -- name is automatically assigned based on the position of the
    -- @ContainerDefinition@ in the pipeline. If you specify a value for the
    -- @ContainerHostName@ for any @ContainerDefinition@ that is part of an
    -- inference pipeline, you must specify a value for the @ContainerHostName@
    -- parameter of every @ContainerDefinition@ in that pipeline.
    ContainerDefinition -> Maybe Text
containerHostname :: 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.
    ContainerDefinition -> Maybe (HashMap Text Text)
environment :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The path where inference code is stored. This can be either in Amazon
    -- EC2 Container Registry or in a Docker registry that is accessible from
    -- the same VPC that you configure for your endpoint. If you are using your
    -- own custom algorithm instead of an algorithm provided by SageMaker, the
    -- inference code must meet SageMaker requirements. 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>
    ContainerDefinition -> Maybe Text
image :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the model container is in Amazon ECR or a private
    -- Docker registry accessible from your Amazon Virtual Private Cloud (VPC).
    -- For information about storing containers in a private Docker registry,
    -- see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-containers-inference-private.html Use a Private Docker Registry for Real-Time Inference Containers>
    ContainerDefinition -> Maybe ImageConfig
imageConfig :: Prelude.Maybe ImageConfig,
    -- | The inference specification name in the model package version.
    ContainerDefinition -> Maybe Text
inferenceSpecificationName :: Prelude.Maybe Prelude.Text,
    -- | Whether the container hosts a single model or multiple models.
    ContainerDefinition -> Maybe ContainerMode
mode :: Prelude.Maybe ContainerMode,
    -- | The 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 S3 path is required for SageMaker built-in
    -- algorithms, but not if you use your own algorithms. For more information
    -- on built-in algorithms, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html Common Parameters>.
    --
    -- The model artifacts must be in an S3 bucket that is in the same region
    -- as the model or endpoint you are creating.
    --
    -- If you provide a value for this parameter, SageMaker uses Amazon Web
    -- Services Security Token Service to download model artifacts from the S3
    -- path you provide. Amazon Web Services STS is activated in your IAM user
    -- account by default. If you previously deactivated Amazon Web Services
    -- STS for a region, you need to reactivate Amazon Web Services STS for
    -- that region. For more information, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region>
    -- in the /Amazon Web Services Identity and Access Management User Guide/.
    --
    -- If you use a built-in algorithm to create a model, SageMaker requires
    -- that you provide a S3 path to the model artifacts in @ModelDataUrl@.
    ContainerDefinition -> Maybe Text
modelDataUrl :: Prelude.Maybe Prelude.Text,
    -- | The name or Amazon Resource Name (ARN) of the model package to use to
    -- create the model.
    ContainerDefinition -> Maybe Text
modelPackageName :: Prelude.Maybe Prelude.Text,
    -- | Specifies additional configuration for multi-model endpoints.
    ContainerDefinition -> Maybe MultiModelConfig
multiModelConfig :: Prelude.Maybe MultiModelConfig
  }
  deriving (ContainerDefinition -> ContainerDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerDefinition -> ContainerDefinition -> Bool
$c/= :: ContainerDefinition -> ContainerDefinition -> Bool
== :: ContainerDefinition -> ContainerDefinition -> Bool
$c== :: ContainerDefinition -> ContainerDefinition -> Bool
Prelude.Eq, ReadPrec [ContainerDefinition]
ReadPrec ContainerDefinition
Int -> ReadS ContainerDefinition
ReadS [ContainerDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerDefinition]
$creadListPrec :: ReadPrec [ContainerDefinition]
readPrec :: ReadPrec ContainerDefinition
$creadPrec :: ReadPrec ContainerDefinition
readList :: ReadS [ContainerDefinition]
$creadList :: ReadS [ContainerDefinition]
readsPrec :: Int -> ReadS ContainerDefinition
$creadsPrec :: Int -> ReadS ContainerDefinition
Prelude.Read, Int -> ContainerDefinition -> ShowS
[ContainerDefinition] -> ShowS
ContainerDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerDefinition] -> ShowS
$cshowList :: [ContainerDefinition] -> ShowS
show :: ContainerDefinition -> String
$cshow :: ContainerDefinition -> String
showsPrec :: Int -> ContainerDefinition -> ShowS
$cshowsPrec :: Int -> ContainerDefinition -> ShowS
Prelude.Show, forall x. Rep ContainerDefinition x -> ContainerDefinition
forall x. ContainerDefinition -> Rep ContainerDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerDefinition x -> ContainerDefinition
$cfrom :: forall x. ContainerDefinition -> Rep ContainerDefinition x
Prelude.Generic)

-- |
-- Create a value of 'ContainerDefinition' 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:
--
-- 'containerHostname', 'containerDefinition_containerHostname' - This parameter is ignored for models that contain only a
-- @PrimaryContainer@.
--
-- When a @ContainerDefinition@ is part of an inference pipeline, the value
-- of the parameter uniquely identifies the container for the purposes of
-- logging and metrics. For information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/inference-pipeline-logs-metrics.html Use Logs and Metrics to Monitor an Inference Pipeline>.
-- If you don\'t specify a value for this parameter for a
-- @ContainerDefinition@ that is part of an inference pipeline, a unique
-- name is automatically assigned based on the position of the
-- @ContainerDefinition@ in the pipeline. If you specify a value for the
-- @ContainerHostName@ for any @ContainerDefinition@ that is part of an
-- inference pipeline, you must specify a value for the @ContainerHostName@
-- parameter of every @ContainerDefinition@ in that pipeline.
--
-- 'environment', 'containerDefinition_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.
--
-- 'image', 'containerDefinition_image' - The path where inference code is stored. This can be either in Amazon
-- EC2 Container Registry or in a Docker registry that is accessible from
-- the same VPC that you configure for your endpoint. If you are using your
-- own custom algorithm instead of an algorithm provided by SageMaker, the
-- inference code must meet SageMaker requirements. 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>
--
-- 'imageConfig', 'containerDefinition_imageConfig' - Specifies whether the model container is in Amazon ECR or a private
-- Docker registry accessible from your Amazon Virtual Private Cloud (VPC).
-- For information about storing containers in a private Docker registry,
-- see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-containers-inference-private.html Use a Private Docker Registry for Real-Time Inference Containers>
--
-- 'inferenceSpecificationName', 'containerDefinition_inferenceSpecificationName' - The inference specification name in the model package version.
--
-- 'mode', 'containerDefinition_mode' - Whether the container hosts a single model or multiple models.
--
-- 'modelDataUrl', 'containerDefinition_modelDataUrl' - The 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 S3 path is required for SageMaker built-in
-- algorithms, but not if you use your own algorithms. For more information
-- on built-in algorithms, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html Common Parameters>.
--
-- The model artifacts must be in an S3 bucket that is in the same region
-- as the model or endpoint you are creating.
--
-- If you provide a value for this parameter, SageMaker uses Amazon Web
-- Services Security Token Service to download model artifacts from the S3
-- path you provide. Amazon Web Services STS is activated in your IAM user
-- account by default. If you previously deactivated Amazon Web Services
-- STS for a region, you need to reactivate Amazon Web Services STS for
-- that region. For more information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region>
-- in the /Amazon Web Services Identity and Access Management User Guide/.
--
-- If you use a built-in algorithm to create a model, SageMaker requires
-- that you provide a S3 path to the model artifacts in @ModelDataUrl@.
--
-- 'modelPackageName', 'containerDefinition_modelPackageName' - The name or Amazon Resource Name (ARN) of the model package to use to
-- create the model.
--
-- 'multiModelConfig', 'containerDefinition_multiModelConfig' - Specifies additional configuration for multi-model endpoints.
newContainerDefinition ::
  ContainerDefinition
newContainerDefinition :: ContainerDefinition
newContainerDefinition =
  ContainerDefinition'
    { $sel:containerHostname:ContainerDefinition' :: Maybe Text
containerHostname =
        forall a. Maybe a
Prelude.Nothing,
      $sel:environment:ContainerDefinition' :: Maybe (HashMap Text Text)
environment = forall a. Maybe a
Prelude.Nothing,
      $sel:image:ContainerDefinition' :: Maybe Text
image = forall a. Maybe a
Prelude.Nothing,
      $sel:imageConfig:ContainerDefinition' :: Maybe ImageConfig
imageConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:inferenceSpecificationName:ContainerDefinition' :: Maybe Text
inferenceSpecificationName = forall a. Maybe a
Prelude.Nothing,
      $sel:mode:ContainerDefinition' :: Maybe ContainerMode
mode = forall a. Maybe a
Prelude.Nothing,
      $sel:modelDataUrl:ContainerDefinition' :: Maybe Text
modelDataUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:modelPackageName:ContainerDefinition' :: Maybe Text
modelPackageName = forall a. Maybe a
Prelude.Nothing,
      $sel:multiModelConfig:ContainerDefinition' :: Maybe MultiModelConfig
multiModelConfig = forall a. Maybe a
Prelude.Nothing
    }

-- | This parameter is ignored for models that contain only a
-- @PrimaryContainer@.
--
-- When a @ContainerDefinition@ is part of an inference pipeline, the value
-- of the parameter uniquely identifies the container for the purposes of
-- logging and metrics. For information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/inference-pipeline-logs-metrics.html Use Logs and Metrics to Monitor an Inference Pipeline>.
-- If you don\'t specify a value for this parameter for a
-- @ContainerDefinition@ that is part of an inference pipeline, a unique
-- name is automatically assigned based on the position of the
-- @ContainerDefinition@ in the pipeline. If you specify a value for the
-- @ContainerHostName@ for any @ContainerDefinition@ that is part of an
-- inference pipeline, you must specify a value for the @ContainerHostName@
-- parameter of every @ContainerDefinition@ in that pipeline.
containerDefinition_containerHostname :: Lens.Lens' ContainerDefinition (Prelude.Maybe Prelude.Text)
containerDefinition_containerHostname :: Lens' ContainerDefinition (Maybe Text)
containerDefinition_containerHostname = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDefinition' {Maybe Text
containerHostname :: Maybe Text
$sel:containerHostname:ContainerDefinition' :: ContainerDefinition -> Maybe Text
containerHostname} -> Maybe Text
containerHostname) (\s :: ContainerDefinition
s@ContainerDefinition' {} Maybe Text
a -> ContainerDefinition
s {$sel:containerHostname:ContainerDefinition' :: Maybe Text
containerHostname = Maybe Text
a} :: ContainerDefinition)

-- | 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.
containerDefinition_environment :: Lens.Lens' ContainerDefinition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
containerDefinition_environment :: Lens' ContainerDefinition (Maybe (HashMap Text Text))
containerDefinition_environment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDefinition' {Maybe (HashMap Text Text)
environment :: Maybe (HashMap Text Text)
$sel:environment:ContainerDefinition' :: ContainerDefinition -> Maybe (HashMap Text Text)
environment} -> Maybe (HashMap Text Text)
environment) (\s :: ContainerDefinition
s@ContainerDefinition' {} Maybe (HashMap Text Text)
a -> ContainerDefinition
s {$sel:environment:ContainerDefinition' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
a} :: ContainerDefinition) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The path where inference code is stored. This can be either in Amazon
-- EC2 Container Registry or in a Docker registry that is accessible from
-- the same VPC that you configure for your endpoint. If you are using your
-- own custom algorithm instead of an algorithm provided by SageMaker, the
-- inference code must meet SageMaker requirements. 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>
containerDefinition_image :: Lens.Lens' ContainerDefinition (Prelude.Maybe Prelude.Text)
containerDefinition_image :: Lens' ContainerDefinition (Maybe Text)
containerDefinition_image = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDefinition' {Maybe Text
image :: Maybe Text
$sel:image:ContainerDefinition' :: ContainerDefinition -> Maybe Text
image} -> Maybe Text
image) (\s :: ContainerDefinition
s@ContainerDefinition' {} Maybe Text
a -> ContainerDefinition
s {$sel:image:ContainerDefinition' :: Maybe Text
image = Maybe Text
a} :: ContainerDefinition)

-- | Specifies whether the model container is in Amazon ECR or a private
-- Docker registry accessible from your Amazon Virtual Private Cloud (VPC).
-- For information about storing containers in a private Docker registry,
-- see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-containers-inference-private.html Use a Private Docker Registry for Real-Time Inference Containers>
containerDefinition_imageConfig :: Lens.Lens' ContainerDefinition (Prelude.Maybe ImageConfig)
containerDefinition_imageConfig :: Lens' ContainerDefinition (Maybe ImageConfig)
containerDefinition_imageConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDefinition' {Maybe ImageConfig
imageConfig :: Maybe ImageConfig
$sel:imageConfig:ContainerDefinition' :: ContainerDefinition -> Maybe ImageConfig
imageConfig} -> Maybe ImageConfig
imageConfig) (\s :: ContainerDefinition
s@ContainerDefinition' {} Maybe ImageConfig
a -> ContainerDefinition
s {$sel:imageConfig:ContainerDefinition' :: Maybe ImageConfig
imageConfig = Maybe ImageConfig
a} :: ContainerDefinition)

-- | The inference specification name in the model package version.
containerDefinition_inferenceSpecificationName :: Lens.Lens' ContainerDefinition (Prelude.Maybe Prelude.Text)
containerDefinition_inferenceSpecificationName :: Lens' ContainerDefinition (Maybe Text)
containerDefinition_inferenceSpecificationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDefinition' {Maybe Text
inferenceSpecificationName :: Maybe Text
$sel:inferenceSpecificationName:ContainerDefinition' :: ContainerDefinition -> Maybe Text
inferenceSpecificationName} -> Maybe Text
inferenceSpecificationName) (\s :: ContainerDefinition
s@ContainerDefinition' {} Maybe Text
a -> ContainerDefinition
s {$sel:inferenceSpecificationName:ContainerDefinition' :: Maybe Text
inferenceSpecificationName = Maybe Text
a} :: ContainerDefinition)

-- | Whether the container hosts a single model or multiple models.
containerDefinition_mode :: Lens.Lens' ContainerDefinition (Prelude.Maybe ContainerMode)
containerDefinition_mode :: Lens' ContainerDefinition (Maybe ContainerMode)
containerDefinition_mode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDefinition' {Maybe ContainerMode
mode :: Maybe ContainerMode
$sel:mode:ContainerDefinition' :: ContainerDefinition -> Maybe ContainerMode
mode} -> Maybe ContainerMode
mode) (\s :: ContainerDefinition
s@ContainerDefinition' {} Maybe ContainerMode
a -> ContainerDefinition
s {$sel:mode:ContainerDefinition' :: Maybe ContainerMode
mode = Maybe ContainerMode
a} :: ContainerDefinition)

-- | The 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 S3 path is required for SageMaker built-in
-- algorithms, but not if you use your own algorithms. For more information
-- on built-in algorithms, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html Common Parameters>.
--
-- The model artifacts must be in an S3 bucket that is in the same region
-- as the model or endpoint you are creating.
--
-- If you provide a value for this parameter, SageMaker uses Amazon Web
-- Services Security Token Service to download model artifacts from the S3
-- path you provide. Amazon Web Services STS is activated in your IAM user
-- account by default. If you previously deactivated Amazon Web Services
-- STS for a region, you need to reactivate Amazon Web Services STS for
-- that region. For more information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region>
-- in the /Amazon Web Services Identity and Access Management User Guide/.
--
-- If you use a built-in algorithm to create a model, SageMaker requires
-- that you provide a S3 path to the model artifacts in @ModelDataUrl@.
containerDefinition_modelDataUrl :: Lens.Lens' ContainerDefinition (Prelude.Maybe Prelude.Text)
containerDefinition_modelDataUrl :: Lens' ContainerDefinition (Maybe Text)
containerDefinition_modelDataUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDefinition' {Maybe Text
modelDataUrl :: Maybe Text
$sel:modelDataUrl:ContainerDefinition' :: ContainerDefinition -> Maybe Text
modelDataUrl} -> Maybe Text
modelDataUrl) (\s :: ContainerDefinition
s@ContainerDefinition' {} Maybe Text
a -> ContainerDefinition
s {$sel:modelDataUrl:ContainerDefinition' :: Maybe Text
modelDataUrl = Maybe Text
a} :: ContainerDefinition)

-- | The name or Amazon Resource Name (ARN) of the model package to use to
-- create the model.
containerDefinition_modelPackageName :: Lens.Lens' ContainerDefinition (Prelude.Maybe Prelude.Text)
containerDefinition_modelPackageName :: Lens' ContainerDefinition (Maybe Text)
containerDefinition_modelPackageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDefinition' {Maybe Text
modelPackageName :: Maybe Text
$sel:modelPackageName:ContainerDefinition' :: ContainerDefinition -> Maybe Text
modelPackageName} -> Maybe Text
modelPackageName) (\s :: ContainerDefinition
s@ContainerDefinition' {} Maybe Text
a -> ContainerDefinition
s {$sel:modelPackageName:ContainerDefinition' :: Maybe Text
modelPackageName = Maybe Text
a} :: ContainerDefinition)

-- | Specifies additional configuration for multi-model endpoints.
containerDefinition_multiModelConfig :: Lens.Lens' ContainerDefinition (Prelude.Maybe MultiModelConfig)
containerDefinition_multiModelConfig :: Lens' ContainerDefinition (Maybe MultiModelConfig)
containerDefinition_multiModelConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerDefinition' {Maybe MultiModelConfig
multiModelConfig :: Maybe MultiModelConfig
$sel:multiModelConfig:ContainerDefinition' :: ContainerDefinition -> Maybe MultiModelConfig
multiModelConfig} -> Maybe MultiModelConfig
multiModelConfig) (\s :: ContainerDefinition
s@ContainerDefinition' {} Maybe MultiModelConfig
a -> ContainerDefinition
s {$sel:multiModelConfig:ContainerDefinition' :: Maybe MultiModelConfig
multiModelConfig = Maybe MultiModelConfig
a} :: ContainerDefinition)

instance Data.FromJSON ContainerDefinition where
  parseJSON :: Value -> Parser ContainerDefinition
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContainerDefinition"
      ( \Object
x ->
          Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe ImageConfig
-> Maybe Text
-> Maybe ContainerMode
-> Maybe Text
-> Maybe Text
-> Maybe MultiModelConfig
-> ContainerDefinition
ContainerDefinition'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ContainerHostname")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Environment" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Image")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ImageConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InferenceSpecificationName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Mode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ModelDataUrl")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ModelPackageName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MultiModelConfig")
      )

instance Prelude.Hashable ContainerDefinition where
  hashWithSalt :: Int -> ContainerDefinition -> Int
hashWithSalt Int
_salt ContainerDefinition' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContainerMode
Maybe MultiModelConfig
Maybe ImageConfig
multiModelConfig :: Maybe MultiModelConfig
modelPackageName :: Maybe Text
modelDataUrl :: Maybe Text
mode :: Maybe ContainerMode
inferenceSpecificationName :: Maybe Text
imageConfig :: Maybe ImageConfig
image :: Maybe Text
environment :: Maybe (HashMap Text Text)
containerHostname :: Maybe Text
$sel:multiModelConfig:ContainerDefinition' :: ContainerDefinition -> Maybe MultiModelConfig
$sel:modelPackageName:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:modelDataUrl:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:mode:ContainerDefinition' :: ContainerDefinition -> Maybe ContainerMode
$sel:inferenceSpecificationName:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:imageConfig:ContainerDefinition' :: ContainerDefinition -> Maybe ImageConfig
$sel:image:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:environment:ContainerDefinition' :: ContainerDefinition -> Maybe (HashMap Text Text)
$sel:containerHostname:ContainerDefinition' :: ContainerDefinition -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
containerHostname
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
environment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
image
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ImageConfig
imageConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
inferenceSpecificationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContainerMode
mode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelDataUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelPackageName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MultiModelConfig
multiModelConfig

instance Prelude.NFData ContainerDefinition where
  rnf :: ContainerDefinition -> ()
rnf ContainerDefinition' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContainerMode
Maybe MultiModelConfig
Maybe ImageConfig
multiModelConfig :: Maybe MultiModelConfig
modelPackageName :: Maybe Text
modelDataUrl :: Maybe Text
mode :: Maybe ContainerMode
inferenceSpecificationName :: Maybe Text
imageConfig :: Maybe ImageConfig
image :: Maybe Text
environment :: Maybe (HashMap Text Text)
containerHostname :: Maybe Text
$sel:multiModelConfig:ContainerDefinition' :: ContainerDefinition -> Maybe MultiModelConfig
$sel:modelPackageName:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:modelDataUrl:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:mode:ContainerDefinition' :: ContainerDefinition -> Maybe ContainerMode
$sel:inferenceSpecificationName:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:imageConfig:ContainerDefinition' :: ContainerDefinition -> Maybe ImageConfig
$sel:image:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:environment:ContainerDefinition' :: ContainerDefinition -> Maybe (HashMap Text Text)
$sel:containerHostname:ContainerDefinition' :: ContainerDefinition -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
containerHostname
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
environment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
image
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ImageConfig
imageConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
inferenceSpecificationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContainerMode
mode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modelDataUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modelPackageName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MultiModelConfig
multiModelConfig

instance Data.ToJSON ContainerDefinition where
  toJSON :: ContainerDefinition -> Value
toJSON ContainerDefinition' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContainerMode
Maybe MultiModelConfig
Maybe ImageConfig
multiModelConfig :: Maybe MultiModelConfig
modelPackageName :: Maybe Text
modelDataUrl :: Maybe Text
mode :: Maybe ContainerMode
inferenceSpecificationName :: Maybe Text
imageConfig :: Maybe ImageConfig
image :: Maybe Text
environment :: Maybe (HashMap Text Text)
containerHostname :: Maybe Text
$sel:multiModelConfig:ContainerDefinition' :: ContainerDefinition -> Maybe MultiModelConfig
$sel:modelPackageName:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:modelDataUrl:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:mode:ContainerDefinition' :: ContainerDefinition -> Maybe ContainerMode
$sel:inferenceSpecificationName:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:imageConfig:ContainerDefinition' :: ContainerDefinition -> Maybe ImageConfig
$sel:image:ContainerDefinition' :: ContainerDefinition -> Maybe Text
$sel:environment:ContainerDefinition' :: ContainerDefinition -> Maybe (HashMap Text Text)
$sel:containerHostname:ContainerDefinition' :: ContainerDefinition -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ContainerHostname" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
containerHostname,
            (Key
"Environment" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
environment,
            (Key
"Image" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
image,
            (Key
"ImageConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ImageConfig
imageConfig,
            (Key
"InferenceSpecificationName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
inferenceSpecificationName,
            (Key
"Mode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContainerMode
mode,
            (Key
"ModelDataUrl" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
modelDataUrl,
            (Key
"ModelPackageName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
modelPackageName,
            (Key
"MultiModelConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MultiModelConfig
multiModelConfig
          ]
      )