{-# 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.ImageFailure where
import qualified Amazonka.Core as Core
import Amazonka.ECRPublic.Types.ImageFailureCode
import Amazonka.ECRPublic.Types.ImageIdentifier
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ImageFailure = ImageFailure'
{
ImageFailure -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
ImageFailure -> Maybe ImageFailureCode
failureCode :: Prelude.Maybe ImageFailureCode,
ImageFailure -> Maybe ImageIdentifier
imageId :: Prelude.Maybe ImageIdentifier
}
deriving (ImageFailure -> ImageFailure -> Bool
(ImageFailure -> ImageFailure -> Bool)
-> (ImageFailure -> ImageFailure -> Bool) -> Eq ImageFailure
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageFailure -> ImageFailure -> Bool
$c/= :: ImageFailure -> ImageFailure -> Bool
== :: ImageFailure -> ImageFailure -> Bool
$c== :: ImageFailure -> ImageFailure -> Bool
Prelude.Eq, ReadPrec [ImageFailure]
ReadPrec ImageFailure
Int -> ReadS ImageFailure
ReadS [ImageFailure]
(Int -> ReadS ImageFailure)
-> ReadS [ImageFailure]
-> ReadPrec ImageFailure
-> ReadPrec [ImageFailure]
-> Read ImageFailure
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImageFailure]
$creadListPrec :: ReadPrec [ImageFailure]
readPrec :: ReadPrec ImageFailure
$creadPrec :: ReadPrec ImageFailure
readList :: ReadS [ImageFailure]
$creadList :: ReadS [ImageFailure]
readsPrec :: Int -> ReadS ImageFailure
$creadsPrec :: Int -> ReadS ImageFailure
Prelude.Read, Int -> ImageFailure -> ShowS
[ImageFailure] -> ShowS
ImageFailure -> String
(Int -> ImageFailure -> ShowS)
-> (ImageFailure -> String)
-> ([ImageFailure] -> ShowS)
-> Show ImageFailure
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageFailure] -> ShowS
$cshowList :: [ImageFailure] -> ShowS
show :: ImageFailure -> String
$cshow :: ImageFailure -> String
showsPrec :: Int -> ImageFailure -> ShowS
$cshowsPrec :: Int -> ImageFailure -> ShowS
Prelude.Show, (forall x. ImageFailure -> Rep ImageFailure x)
-> (forall x. Rep ImageFailure x -> ImageFailure)
-> Generic ImageFailure
forall x. Rep ImageFailure x -> ImageFailure
forall x. ImageFailure -> Rep ImageFailure x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageFailure x -> ImageFailure
$cfrom :: forall x. ImageFailure -> Rep ImageFailure x
Prelude.Generic)
newImageFailure ::
ImageFailure
newImageFailure :: ImageFailure
newImageFailure =
ImageFailure' :: Maybe Text
-> Maybe ImageFailureCode -> Maybe ImageIdentifier -> ImageFailure
ImageFailure'
{ $sel:failureReason:ImageFailure' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:failureCode:ImageFailure' :: Maybe ImageFailureCode
failureCode = Maybe ImageFailureCode
forall a. Maybe a
Prelude.Nothing,
$sel:imageId:ImageFailure' :: Maybe ImageIdentifier
imageId = Maybe ImageIdentifier
forall a. Maybe a
Prelude.Nothing
}
imageFailure_failureReason :: Lens.Lens' ImageFailure (Prelude.Maybe Prelude.Text)
imageFailure_failureReason :: (Maybe Text -> f (Maybe Text)) -> ImageFailure -> f ImageFailure
imageFailure_failureReason = (ImageFailure -> Maybe Text)
-> (ImageFailure -> Maybe Text -> ImageFailure)
-> Lens ImageFailure ImageFailure (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageFailure' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:ImageFailure' :: ImageFailure -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: ImageFailure
s@ImageFailure' {} Maybe Text
a -> ImageFailure
s {$sel:failureReason:ImageFailure' :: Maybe Text
failureReason = Maybe Text
a} :: ImageFailure)
imageFailure_failureCode :: Lens.Lens' ImageFailure (Prelude.Maybe ImageFailureCode)
imageFailure_failureCode :: (Maybe ImageFailureCode -> f (Maybe ImageFailureCode))
-> ImageFailure -> f ImageFailure
imageFailure_failureCode = (ImageFailure -> Maybe ImageFailureCode)
-> (ImageFailure -> Maybe ImageFailureCode -> ImageFailure)
-> Lens
ImageFailure
ImageFailure
(Maybe ImageFailureCode)
(Maybe ImageFailureCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageFailure' {Maybe ImageFailureCode
failureCode :: Maybe ImageFailureCode
$sel:failureCode:ImageFailure' :: ImageFailure -> Maybe ImageFailureCode
failureCode} -> Maybe ImageFailureCode
failureCode) (\s :: ImageFailure
s@ImageFailure' {} Maybe ImageFailureCode
a -> ImageFailure
s {$sel:failureCode:ImageFailure' :: Maybe ImageFailureCode
failureCode = Maybe ImageFailureCode
a} :: ImageFailure)
imageFailure_imageId :: Lens.Lens' ImageFailure (Prelude.Maybe ImageIdentifier)
imageFailure_imageId :: (Maybe ImageIdentifier -> f (Maybe ImageIdentifier))
-> ImageFailure -> f ImageFailure
imageFailure_imageId = (ImageFailure -> Maybe ImageIdentifier)
-> (ImageFailure -> Maybe ImageIdentifier -> ImageFailure)
-> Lens
ImageFailure
ImageFailure
(Maybe ImageIdentifier)
(Maybe ImageIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageFailure' {Maybe ImageIdentifier
imageId :: Maybe ImageIdentifier
$sel:imageId:ImageFailure' :: ImageFailure -> Maybe ImageIdentifier
imageId} -> Maybe ImageIdentifier
imageId) (\s :: ImageFailure
s@ImageFailure' {} Maybe ImageIdentifier
a -> ImageFailure
s {$sel:imageId:ImageFailure' :: Maybe ImageIdentifier
imageId = Maybe ImageIdentifier
a} :: ImageFailure)
instance Core.FromJSON ImageFailure where
parseJSON :: Value -> Parser ImageFailure
parseJSON =
String
-> (Object -> Parser ImageFailure) -> Value -> Parser ImageFailure
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ImageFailure"
( \Object
x ->
Maybe Text
-> Maybe ImageFailureCode -> Maybe ImageIdentifier -> ImageFailure
ImageFailure'
(Maybe Text
-> Maybe ImageFailureCode -> Maybe ImageIdentifier -> ImageFailure)
-> Parser (Maybe Text)
-> Parser
(Maybe ImageFailureCode -> Maybe ImageIdentifier -> ImageFailure)
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 ImageFailureCode -> Maybe ImageIdentifier -> ImageFailure)
-> Parser (Maybe ImageFailureCode)
-> Parser (Maybe ImageIdentifier -> ImageFailure)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImageFailureCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"failureCode")
Parser (Maybe ImageIdentifier -> ImageFailure)
-> Parser (Maybe ImageIdentifier) -> Parser ImageFailure
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")
)
instance Prelude.Hashable ImageFailure
instance Prelude.NFData ImageFailure