{-# 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.Image where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.ImageStatus
data Image = Image'
{
Image -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
Image -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
Image -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Image -> POSIX
creationTime :: Core.POSIX,
Image -> Text
imageArn :: Prelude.Text,
Image -> Text
imageName :: Prelude.Text,
Image -> ImageStatus
imageStatus :: ImageStatus,
Image -> POSIX
lastModifiedTime :: Core.POSIX
}
deriving (Image -> Image -> Bool
(Image -> Image -> Bool) -> (Image -> Image -> Bool) -> Eq Image
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Image -> Image -> Bool
$c/= :: Image -> Image -> Bool
== :: Image -> Image -> Bool
$c== :: Image -> Image -> Bool
Prelude.Eq, ReadPrec [Image]
ReadPrec Image
Int -> ReadS Image
ReadS [Image]
(Int -> ReadS Image)
-> ReadS [Image]
-> ReadPrec Image
-> ReadPrec [Image]
-> Read Image
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Image]
$creadListPrec :: ReadPrec [Image]
readPrec :: ReadPrec Image
$creadPrec :: ReadPrec Image
readList :: ReadS [Image]
$creadList :: ReadS [Image]
readsPrec :: Int -> ReadS Image
$creadsPrec :: Int -> ReadS Image
Prelude.Read, Int -> Image -> ShowS
[Image] -> ShowS
Image -> String
(Int -> Image -> ShowS)
-> (Image -> String) -> ([Image] -> ShowS) -> Show Image
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Image] -> ShowS
$cshowList :: [Image] -> ShowS
show :: Image -> String
$cshow :: Image -> String
showsPrec :: Int -> Image -> ShowS
$cshowsPrec :: Int -> Image -> ShowS
Prelude.Show, (forall x. Image -> Rep Image x)
-> (forall x. Rep Image x -> Image) -> Generic Image
forall x. Rep Image x -> Image
forall x. Image -> Rep Image x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Image x -> Image
$cfrom :: forall x. Image -> Rep Image x
Prelude.Generic)
newImage ::
Prelude.UTCTime ->
Prelude.Text ->
Prelude.Text ->
ImageStatus ->
Prelude.UTCTime ->
Image
newImage :: UTCTime -> Text -> Text -> ImageStatus -> UTCTime -> Image
newImage
UTCTime
pCreationTime_
Text
pImageArn_
Text
pImageName_
ImageStatus
pImageStatus_
UTCTime
pLastModifiedTime_ =
Image' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> POSIX
-> Text
-> Text
-> ImageStatus
-> POSIX
-> Image
Image'
{ $sel:failureReason:Image' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:displayName:Image' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:Image' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:Image' :: POSIX
creationTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
$sel:imageArn:Image' :: Text
imageArn = Text
pImageArn_,
$sel:imageName:Image' :: Text
imageName = Text
pImageName_,
$sel:imageStatus:Image' :: ImageStatus
imageStatus = ImageStatus
pImageStatus_,
$sel:lastModifiedTime:Image' :: POSIX
lastModifiedTime =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_
}
image_failureReason :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_failureReason :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_failureReason = (Image -> Maybe Text)
-> (Image -> Maybe Text -> Image)
-> Lens Image Image (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:Image' :: Image -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:failureReason:Image' :: Maybe Text
failureReason = Maybe Text
a} :: Image)
image_displayName :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_displayName :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_displayName = (Image -> Maybe Text)
-> (Image -> Maybe Text -> Image)
-> Lens Image Image (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Text
displayName :: Maybe Text
$sel:displayName:Image' :: Image -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:displayName:Image' :: Maybe Text
displayName = Maybe Text
a} :: Image)
image_description :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_description :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_description = (Image -> Maybe Text)
-> (Image -> Maybe Text -> Image)
-> Lens Image Image (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe Text
description :: Maybe Text
$sel:description:Image' :: Image -> Maybe Text
description} -> Maybe Text
description) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:description:Image' :: Maybe Text
description = Maybe Text
a} :: Image)
image_creationTime :: Lens.Lens' Image Prelude.UTCTime
image_creationTime :: (UTCTime -> f UTCTime) -> Image -> f Image
image_creationTime = (Image -> POSIX)
-> (Image -> POSIX -> Image) -> Lens Image Image POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {POSIX
creationTime :: POSIX
$sel:creationTime:Image' :: Image -> POSIX
creationTime} -> POSIX
creationTime) (\s :: Image
s@Image' {} POSIX
a -> Image
s {$sel:creationTime:Image' :: POSIX
creationTime = POSIX
a} :: Image) ((POSIX -> f POSIX) -> Image -> f Image)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Image
-> f Image
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
image_imageArn :: Lens.Lens' Image Prelude.Text
image_imageArn :: (Text -> f Text) -> Image -> f Image
image_imageArn = (Image -> Text)
-> (Image -> Text -> Image) -> Lens Image Image Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Text
imageArn :: Text
$sel:imageArn:Image' :: Image -> Text
imageArn} -> Text
imageArn) (\s :: Image
s@Image' {} Text
a -> Image
s {$sel:imageArn:Image' :: Text
imageArn = Text
a} :: Image)
image_imageName :: Lens.Lens' Image Prelude.Text
image_imageName :: (Text -> f Text) -> Image -> f Image
image_imageName = (Image -> Text)
-> (Image -> Text -> Image) -> Lens Image Image Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Text
imageName :: Text
$sel:imageName:Image' :: Image -> Text
imageName} -> Text
imageName) (\s :: Image
s@Image' {} Text
a -> Image
s {$sel:imageName:Image' :: Text
imageName = Text
a} :: Image)
image_imageStatus :: Lens.Lens' Image ImageStatus
image_imageStatus :: (ImageStatus -> f ImageStatus) -> Image -> f Image
image_imageStatus = (Image -> ImageStatus)
-> (Image -> ImageStatus -> Image)
-> Lens Image Image ImageStatus ImageStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {ImageStatus
imageStatus :: ImageStatus
$sel:imageStatus:Image' :: Image -> ImageStatus
imageStatus} -> ImageStatus
imageStatus) (\s :: Image
s@Image' {} ImageStatus
a -> Image
s {$sel:imageStatus:Image' :: ImageStatus
imageStatus = ImageStatus
a} :: Image)
image_lastModifiedTime :: Lens.Lens' Image Prelude.UTCTime
image_lastModifiedTime :: (UTCTime -> f UTCTime) -> Image -> f Image
image_lastModifiedTime = (Image -> POSIX)
-> (Image -> POSIX -> Image) -> Lens Image Image POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {POSIX
lastModifiedTime :: POSIX
$sel:lastModifiedTime:Image' :: Image -> POSIX
lastModifiedTime} -> POSIX
lastModifiedTime) (\s :: Image
s@Image' {} POSIX
a -> Image
s {$sel:lastModifiedTime:Image' :: POSIX
lastModifiedTime = POSIX
a} :: Image) ((POSIX -> f POSIX) -> Image -> f Image)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Image
-> f Image
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON Image where
parseJSON :: Value -> Parser Image
parseJSON =
String -> (Object -> Parser Image) -> Value -> Parser Image
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Image"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> POSIX
-> Text
-> Text
-> ImageStatus
-> POSIX
-> Image
Image'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> POSIX
-> Text
-> Text
-> ImageStatus
-> POSIX
-> Image)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> POSIX
-> Text
-> Text
-> ImageStatus
-> POSIX
-> Image)
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
"FailureReason")
Parser
(Maybe Text
-> Maybe Text
-> POSIX
-> Text
-> Text
-> ImageStatus
-> POSIX
-> Image)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> POSIX -> Text -> Text -> ImageStatus -> POSIX -> Image)
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
"DisplayName")
Parser
(Maybe Text
-> POSIX -> Text -> Text -> ImageStatus -> POSIX -> Image)
-> Parser (Maybe Text)
-> Parser (POSIX -> Text -> Text -> ImageStatus -> POSIX -> Image)
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
"Description")
Parser (POSIX -> Text -> Text -> ImageStatus -> POSIX -> Image)
-> Parser POSIX
-> Parser (Text -> Text -> ImageStatus -> POSIX -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreationTime")
Parser (Text -> Text -> ImageStatus -> POSIX -> Image)
-> Parser Text -> Parser (Text -> ImageStatus -> POSIX -> Image)
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
"ImageArn")
Parser (Text -> ImageStatus -> POSIX -> Image)
-> Parser Text -> Parser (ImageStatus -> POSIX -> Image)
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 (ImageStatus -> POSIX -> Image)
-> Parser ImageStatus -> Parser (POSIX -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ImageStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ImageStatus")
Parser (POSIX -> Image) -> Parser POSIX -> Parser Image
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"LastModifiedTime")
)
instance Prelude.Hashable Image
instance Prelude.NFData Image