{-# 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.CustomImage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CustomImage = CustomImage'
{
CustomImage -> Maybe Natural
imageVersionNumber :: Prelude.Maybe Prelude.Natural,
CustomImage -> Text
imageName :: Prelude.Text,
CustomImage -> Text
appImageConfigName :: Prelude.Text
}
deriving (CustomImage -> CustomImage -> Bool
(CustomImage -> CustomImage -> Bool)
-> (CustomImage -> CustomImage -> Bool) -> Eq CustomImage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomImage -> CustomImage -> Bool
$c/= :: CustomImage -> CustomImage -> Bool
== :: CustomImage -> CustomImage -> Bool
$c== :: CustomImage -> CustomImage -> Bool
Prelude.Eq, ReadPrec [CustomImage]
ReadPrec CustomImage
Int -> ReadS CustomImage
ReadS [CustomImage]
(Int -> ReadS CustomImage)
-> ReadS [CustomImage]
-> ReadPrec CustomImage
-> ReadPrec [CustomImage]
-> Read CustomImage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomImage]
$creadListPrec :: ReadPrec [CustomImage]
readPrec :: ReadPrec CustomImage
$creadPrec :: ReadPrec CustomImage
readList :: ReadS [CustomImage]
$creadList :: ReadS [CustomImage]
readsPrec :: Int -> ReadS CustomImage
$creadsPrec :: Int -> ReadS CustomImage
Prelude.Read, Int -> CustomImage -> ShowS
[CustomImage] -> ShowS
CustomImage -> String
(Int -> CustomImage -> ShowS)
-> (CustomImage -> String)
-> ([CustomImage] -> ShowS)
-> Show CustomImage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomImage] -> ShowS
$cshowList :: [CustomImage] -> ShowS
show :: CustomImage -> String
$cshow :: CustomImage -> String
showsPrec :: Int -> CustomImage -> ShowS
$cshowsPrec :: Int -> CustomImage -> ShowS
Prelude.Show, (forall x. CustomImage -> Rep CustomImage x)
-> (forall x. Rep CustomImage x -> CustomImage)
-> Generic CustomImage
forall x. Rep CustomImage x -> CustomImage
forall x. CustomImage -> Rep CustomImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomImage x -> CustomImage
$cfrom :: forall x. CustomImage -> Rep CustomImage x
Prelude.Generic)
newCustomImage ::
Prelude.Text ->
Prelude.Text ->
CustomImage
newCustomImage :: Text -> Text -> CustomImage
newCustomImage Text
pImageName_ Text
pAppImageConfigName_ =
CustomImage' :: Maybe Natural -> Text -> Text -> CustomImage
CustomImage'
{ $sel:imageVersionNumber:CustomImage' :: Maybe Natural
imageVersionNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:imageName:CustomImage' :: Text
imageName = Text
pImageName_,
$sel:appImageConfigName:CustomImage' :: Text
appImageConfigName = Text
pAppImageConfigName_
}
customImage_imageVersionNumber :: Lens.Lens' CustomImage (Prelude.Maybe Prelude.Natural)
customImage_imageVersionNumber :: (Maybe Natural -> f (Maybe Natural))
-> CustomImage -> f CustomImage
customImage_imageVersionNumber = (CustomImage -> Maybe Natural)
-> (CustomImage -> Maybe Natural -> CustomImage)
-> Lens CustomImage CustomImage (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomImage' {Maybe Natural
imageVersionNumber :: Maybe Natural
$sel:imageVersionNumber:CustomImage' :: CustomImage -> Maybe Natural
imageVersionNumber} -> Maybe Natural
imageVersionNumber) (\s :: CustomImage
s@CustomImage' {} Maybe Natural
a -> CustomImage
s {$sel:imageVersionNumber:CustomImage' :: Maybe Natural
imageVersionNumber = Maybe Natural
a} :: CustomImage)
customImage_imageName :: Lens.Lens' CustomImage Prelude.Text
customImage_imageName :: (Text -> f Text) -> CustomImage -> f CustomImage
customImage_imageName = (CustomImage -> Text)
-> (CustomImage -> Text -> CustomImage)
-> Lens CustomImage CustomImage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomImage' {Text
imageName :: Text
$sel:imageName:CustomImage' :: CustomImage -> Text
imageName} -> Text
imageName) (\s :: CustomImage
s@CustomImage' {} Text
a -> CustomImage
s {$sel:imageName:CustomImage' :: Text
imageName = Text
a} :: CustomImage)
customImage_appImageConfigName :: Lens.Lens' CustomImage Prelude.Text
customImage_appImageConfigName :: (Text -> f Text) -> CustomImage -> f CustomImage
customImage_appImageConfigName = (CustomImage -> Text)
-> (CustomImage -> Text -> CustomImage)
-> Lens CustomImage CustomImage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomImage' {Text
appImageConfigName :: Text
$sel:appImageConfigName:CustomImage' :: CustomImage -> Text
appImageConfigName} -> Text
appImageConfigName) (\s :: CustomImage
s@CustomImage' {} Text
a -> CustomImage
s {$sel:appImageConfigName:CustomImage' :: Text
appImageConfigName = Text
a} :: CustomImage)
instance Core.FromJSON CustomImage where
parseJSON :: Value -> Parser CustomImage
parseJSON =
String
-> (Object -> Parser CustomImage) -> Value -> Parser CustomImage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CustomImage"
( \Object
x ->
Maybe Natural -> Text -> Text -> CustomImage
CustomImage'
(Maybe Natural -> Text -> Text -> CustomImage)
-> Parser (Maybe Natural) -> Parser (Text -> Text -> CustomImage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImageVersionNumber")
Parser (Text -> Text -> CustomImage)
-> Parser Text -> Parser (Text -> CustomImage)
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
"ImageName")
Parser (Text -> CustomImage) -> Parser Text -> Parser CustomImage
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
"AppImageConfigName")
)
instance Prelude.Hashable CustomImage
instance Prelude.NFData CustomImage
instance Core.ToJSON CustomImage where
toJSON :: CustomImage -> Value
toJSON CustomImage' {Maybe Natural
Text
appImageConfigName :: Text
imageName :: Text
imageVersionNumber :: Maybe Natural
$sel:appImageConfigName:CustomImage' :: CustomImage -> Text
$sel:imageName:CustomImage' :: CustomImage -> Text
$sel:imageVersionNumber:CustomImage' :: CustomImage -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ImageVersionNumber" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
imageVersionNumber,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ImageName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
imageName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AppImageConfigName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
appImageConfigName)
]
)