{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:imageVersionNumber:CustomImage' :: Maybe Natural
imageVersionNumber = 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 :: Lens' CustomImage (Maybe Natural)
customImage_imageVersionNumber = 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 :: Lens' CustomImage Text
customImage_imageName = 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 :: Lens' CustomImage Text
customImage_appImageConfigName = 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 Data.FromJSON CustomImage where
parseJSON :: Value -> Parser CustomImage
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CustomImage"
( \Object
x ->
Maybe Natural -> Text -> Text -> CustomImage
CustomImage'
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
"ImageVersionNumber")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ImageName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AppImageConfigName")
)
instance Prelude.Hashable CustomImage where
hashWithSalt :: Int -> CustomImage -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
imageVersionNumber
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
imageName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appImageConfigName
instance Prelude.NFData CustomImage where
rnf :: CustomImage -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
imageVersionNumber
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
imageName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appImageConfigName
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ImageVersionNumber" 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 Natural
imageVersionNumber,
forall a. a -> Maybe a
Prelude.Just (Key
"ImageName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
imageName),
forall a. a -> Maybe a
Prelude.Just
(Key
"AppImageConfigName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
appImageConfigName)
]
)