{-# 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.Lightsail.Types.ContainerImage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ContainerImage = ContainerImage'
{
ContainerImage -> Maybe Text
image :: Prelude.Maybe Prelude.Text,
ContainerImage -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
ContainerImage -> Maybe Text
digest :: Prelude.Maybe Prelude.Text
}
deriving (ContainerImage -> ContainerImage -> Bool
(ContainerImage -> ContainerImage -> Bool)
-> (ContainerImage -> ContainerImage -> Bool) -> Eq ContainerImage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerImage -> ContainerImage -> Bool
$c/= :: ContainerImage -> ContainerImage -> Bool
== :: ContainerImage -> ContainerImage -> Bool
$c== :: ContainerImage -> ContainerImage -> Bool
Prelude.Eq, ReadPrec [ContainerImage]
ReadPrec ContainerImage
Int -> ReadS ContainerImage
ReadS [ContainerImage]
(Int -> ReadS ContainerImage)
-> ReadS [ContainerImage]
-> ReadPrec ContainerImage
-> ReadPrec [ContainerImage]
-> Read ContainerImage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerImage]
$creadListPrec :: ReadPrec [ContainerImage]
readPrec :: ReadPrec ContainerImage
$creadPrec :: ReadPrec ContainerImage
readList :: ReadS [ContainerImage]
$creadList :: ReadS [ContainerImage]
readsPrec :: Int -> ReadS ContainerImage
$creadsPrec :: Int -> ReadS ContainerImage
Prelude.Read, Int -> ContainerImage -> ShowS
[ContainerImage] -> ShowS
ContainerImage -> String
(Int -> ContainerImage -> ShowS)
-> (ContainerImage -> String)
-> ([ContainerImage] -> ShowS)
-> Show ContainerImage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerImage] -> ShowS
$cshowList :: [ContainerImage] -> ShowS
show :: ContainerImage -> String
$cshow :: ContainerImage -> String
showsPrec :: Int -> ContainerImage -> ShowS
$cshowsPrec :: Int -> ContainerImage -> ShowS
Prelude.Show, (forall x. ContainerImage -> Rep ContainerImage x)
-> (forall x. Rep ContainerImage x -> ContainerImage)
-> Generic ContainerImage
forall x. Rep ContainerImage x -> ContainerImage
forall x. ContainerImage -> Rep ContainerImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerImage x -> ContainerImage
$cfrom :: forall x. ContainerImage -> Rep ContainerImage x
Prelude.Generic)
newContainerImage ::
ContainerImage
newContainerImage :: ContainerImage
newContainerImage =
ContainerImage' :: Maybe Text -> Maybe POSIX -> Maybe Text -> ContainerImage
ContainerImage'
{ $sel:image:ContainerImage' :: Maybe Text
image = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:ContainerImage' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:digest:ContainerImage' :: Maybe Text
digest = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
containerImage_image :: Lens.Lens' ContainerImage (Prelude.Maybe Prelude.Text)
containerImage_image :: (Maybe Text -> f (Maybe Text))
-> ContainerImage -> f ContainerImage
containerImage_image = (ContainerImage -> Maybe Text)
-> (ContainerImage -> Maybe Text -> ContainerImage)
-> Lens ContainerImage ContainerImage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerImage' {Maybe Text
image :: Maybe Text
$sel:image:ContainerImage' :: ContainerImage -> Maybe Text
image} -> Maybe Text
image) (\s :: ContainerImage
s@ContainerImage' {} Maybe Text
a -> ContainerImage
s {$sel:image:ContainerImage' :: Maybe Text
image = Maybe Text
a} :: ContainerImage)
containerImage_createdAt :: Lens.Lens' ContainerImage (Prelude.Maybe Prelude.UTCTime)
containerImage_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ContainerImage -> f ContainerImage
containerImage_createdAt = (ContainerImage -> Maybe POSIX)
-> (ContainerImage -> Maybe POSIX -> ContainerImage)
-> Lens ContainerImage ContainerImage (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerImage' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:ContainerImage' :: ContainerImage -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: ContainerImage
s@ContainerImage' {} Maybe POSIX
a -> ContainerImage
s {$sel:createdAt:ContainerImage' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: ContainerImage) ((Maybe POSIX -> f (Maybe POSIX))
-> ContainerImage -> f ContainerImage)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ContainerImage
-> f ContainerImage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
containerImage_digest :: Lens.Lens' ContainerImage (Prelude.Maybe Prelude.Text)
containerImage_digest :: (Maybe Text -> f (Maybe Text))
-> ContainerImage -> f ContainerImage
containerImage_digest = (ContainerImage -> Maybe Text)
-> (ContainerImage -> Maybe Text -> ContainerImage)
-> Lens ContainerImage ContainerImage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerImage' {Maybe Text
digest :: Maybe Text
$sel:digest:ContainerImage' :: ContainerImage -> Maybe Text
digest} -> Maybe Text
digest) (\s :: ContainerImage
s@ContainerImage' {} Maybe Text
a -> ContainerImage
s {$sel:digest:ContainerImage' :: Maybe Text
digest = Maybe Text
a} :: ContainerImage)
instance Core.FromJSON ContainerImage where
parseJSON :: Value -> Parser ContainerImage
parseJSON =
String
-> (Object -> Parser ContainerImage)
-> Value
-> Parser ContainerImage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ContainerImage"
( \Object
x ->
Maybe Text -> Maybe POSIX -> Maybe Text -> ContainerImage
ContainerImage'
(Maybe Text -> Maybe POSIX -> Maybe Text -> ContainerImage)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> ContainerImage)
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
"image")
Parser (Maybe POSIX -> Maybe Text -> ContainerImage)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> ContainerImage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser (Maybe Text -> ContainerImage)
-> Parser (Maybe Text) -> Parser ContainerImage
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
"digest")
)
instance Prelude.Hashable ContainerImage
instance Prelude.NFData ContainerImage