{-# 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.ECRPublic.Types.Image where
import qualified Amazonka.Core as Core
import Amazonka.ECRPublic.Types.ImageIdentifier
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Image = Image'
{
Image -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
Image -> Maybe Text
imageManifestMediaType :: Prelude.Maybe Prelude.Text,
Image -> Maybe ImageIdentifier
imageId :: Prelude.Maybe ImageIdentifier,
Image -> Maybe Text
repositoryName :: Prelude.Maybe Prelude.Text,
Image -> Maybe Text
imageManifest :: Prelude.Maybe Prelude.Text
}
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 ::
Image
newImage :: Image
newImage =
Image' :: Maybe Text
-> Maybe Text
-> Maybe ImageIdentifier
-> Maybe Text
-> Maybe Text
-> Image
Image'
{ $sel:registryId:Image' :: Maybe Text
registryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageManifestMediaType:Image' :: Maybe Text
imageManifestMediaType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageId:Image' :: Maybe ImageIdentifier
imageId = Maybe ImageIdentifier
forall a. Maybe a
Prelude.Nothing,
$sel:repositoryName:Image' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageManifest:Image' :: Maybe Text
imageManifest = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
image_registryId :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_registryId :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_registryId = (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
registryId :: Maybe Text
$sel:registryId:Image' :: Image -> Maybe Text
registryId} -> Maybe Text
registryId) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:registryId:Image' :: Maybe Text
registryId = Maybe Text
a} :: Image)
image_imageManifestMediaType :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_imageManifestMediaType :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_imageManifestMediaType = (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
imageManifestMediaType :: Maybe Text
$sel:imageManifestMediaType:Image' :: Image -> Maybe Text
imageManifestMediaType} -> Maybe Text
imageManifestMediaType) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:imageManifestMediaType:Image' :: Maybe Text
imageManifestMediaType = Maybe Text
a} :: Image)
image_imageId :: Lens.Lens' Image (Prelude.Maybe ImageIdentifier)
image_imageId :: (Maybe ImageIdentifier -> f (Maybe ImageIdentifier))
-> Image -> f Image
image_imageId = (Image -> Maybe ImageIdentifier)
-> (Image -> Maybe ImageIdentifier -> Image)
-> Lens Image Image (Maybe ImageIdentifier) (Maybe ImageIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Image' {Maybe ImageIdentifier
imageId :: Maybe ImageIdentifier
$sel:imageId:Image' :: Image -> Maybe ImageIdentifier
imageId} -> Maybe ImageIdentifier
imageId) (\s :: Image
s@Image' {} Maybe ImageIdentifier
a -> Image
s {$sel:imageId:Image' :: Maybe ImageIdentifier
imageId = Maybe ImageIdentifier
a} :: Image)
image_repositoryName :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_repositoryName :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_repositoryName = (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
repositoryName :: Maybe Text
$sel:repositoryName:Image' :: Image -> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:repositoryName:Image' :: Maybe Text
repositoryName = Maybe Text
a} :: Image)
image_imageManifest :: Lens.Lens' Image (Prelude.Maybe Prelude.Text)
image_imageManifest :: (Maybe Text -> f (Maybe Text)) -> Image -> f Image
image_imageManifest = (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
imageManifest :: Maybe Text
$sel:imageManifest:Image' :: Image -> Maybe Text
imageManifest} -> Maybe Text
imageManifest) (\s :: Image
s@Image' {} Maybe Text
a -> Image
s {$sel:imageManifest:Image' :: Maybe Text
imageManifest = Maybe Text
a} :: Image)
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 ImageIdentifier
-> Maybe Text
-> Maybe Text
-> Image
Image'
(Maybe Text
-> Maybe Text
-> Maybe ImageIdentifier
-> Maybe Text
-> Maybe Text
-> Image)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ImageIdentifier -> Maybe Text -> Maybe Text -> 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
"registryId")
Parser
(Maybe Text
-> Maybe ImageIdentifier -> Maybe Text -> Maybe Text -> Image)
-> Parser (Maybe Text)
-> Parser
(Maybe ImageIdentifier -> Maybe Text -> Maybe Text -> 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
"imageManifestMediaType")
Parser (Maybe ImageIdentifier -> Maybe Text -> Maybe Text -> Image)
-> Parser (Maybe ImageIdentifier)
-> Parser (Maybe Text -> Maybe Text -> Image)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImageIdentifier)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"imageId")
Parser (Maybe Text -> Maybe Text -> Image)
-> Parser (Maybe Text) -> Parser (Maybe Text -> 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
"repositoryName")
Parser (Maybe Text -> Image) -> Parser (Maybe Text) -> Parser 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
"imageManifest")
)
instance Prelude.Hashable Image
instance Prelude.NFData Image