{-# 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 #-}
module Amazonka.SageMaker.Types.ModelPackageContainerDefinition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ModelPackageContainerDefinition = ModelPackageContainerDefinition'
{
ModelPackageContainerDefinition -> Maybe Text
modelDataUrl :: Prelude.Maybe Prelude.Text,
ModelPackageContainerDefinition -> Maybe (HashMap Text Text)
environment :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ModelPackageContainerDefinition -> Maybe Text
imageDigest :: Prelude.Maybe Prelude.Text,
ModelPackageContainerDefinition -> Maybe Text
containerHostname :: Prelude.Maybe Prelude.Text,
ModelPackageContainerDefinition -> Maybe Text
productId :: Prelude.Maybe Prelude.Text,
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)
newModelPackageContainerDefinition ::
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_
}
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)
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
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)
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)
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)
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)
]
)