{-# 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.ResourceGroups.Types.FailedResource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FailedResource = FailedResource'
{
FailedResource -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
FailedResource -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
FailedResource -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
}
deriving (FailedResource -> FailedResource -> Bool
(FailedResource -> FailedResource -> Bool)
-> (FailedResource -> FailedResource -> Bool) -> Eq FailedResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedResource -> FailedResource -> Bool
$c/= :: FailedResource -> FailedResource -> Bool
== :: FailedResource -> FailedResource -> Bool
$c== :: FailedResource -> FailedResource -> Bool
Prelude.Eq, ReadPrec [FailedResource]
ReadPrec FailedResource
Int -> ReadS FailedResource
ReadS [FailedResource]
(Int -> ReadS FailedResource)
-> ReadS [FailedResource]
-> ReadPrec FailedResource
-> ReadPrec [FailedResource]
-> Read FailedResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedResource]
$creadListPrec :: ReadPrec [FailedResource]
readPrec :: ReadPrec FailedResource
$creadPrec :: ReadPrec FailedResource
readList :: ReadS [FailedResource]
$creadList :: ReadS [FailedResource]
readsPrec :: Int -> ReadS FailedResource
$creadsPrec :: Int -> ReadS FailedResource
Prelude.Read, Int -> FailedResource -> ShowS
[FailedResource] -> ShowS
FailedResource -> String
(Int -> FailedResource -> ShowS)
-> (FailedResource -> String)
-> ([FailedResource] -> ShowS)
-> Show FailedResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedResource] -> ShowS
$cshowList :: [FailedResource] -> ShowS
show :: FailedResource -> String
$cshow :: FailedResource -> String
showsPrec :: Int -> FailedResource -> ShowS
$cshowsPrec :: Int -> FailedResource -> ShowS
Prelude.Show, (forall x. FailedResource -> Rep FailedResource x)
-> (forall x. Rep FailedResource x -> FailedResource)
-> Generic FailedResource
forall x. Rep FailedResource x -> FailedResource
forall x. FailedResource -> Rep FailedResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FailedResource x -> FailedResource
$cfrom :: forall x. FailedResource -> Rep FailedResource x
Prelude.Generic)
newFailedResource ::
FailedResource
newFailedResource :: FailedResource
newFailedResource =
FailedResource' :: Maybe Text -> Maybe Text -> Maybe Text -> FailedResource
FailedResource'
{ $sel:resourceArn:FailedResource' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorCode:FailedResource' :: Maybe Text
errorCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:FailedResource' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
failedResource_resourceArn :: Lens.Lens' FailedResource (Prelude.Maybe Prelude.Text)
failedResource_resourceArn :: (Maybe Text -> f (Maybe Text))
-> FailedResource -> f FailedResource
failedResource_resourceArn = (FailedResource -> Maybe Text)
-> (FailedResource -> Maybe Text -> FailedResource)
-> Lens FailedResource FailedResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedResource' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:FailedResource' :: FailedResource -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: FailedResource
s@FailedResource' {} Maybe Text
a -> FailedResource
s {$sel:resourceArn:FailedResource' :: Maybe Text
resourceArn = Maybe Text
a} :: FailedResource)
failedResource_errorCode :: Lens.Lens' FailedResource (Prelude.Maybe Prelude.Text)
failedResource_errorCode :: (Maybe Text -> f (Maybe Text))
-> FailedResource -> f FailedResource
failedResource_errorCode = (FailedResource -> Maybe Text)
-> (FailedResource -> Maybe Text -> FailedResource)
-> Lens FailedResource FailedResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedResource' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:FailedResource' :: FailedResource -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: FailedResource
s@FailedResource' {} Maybe Text
a -> FailedResource
s {$sel:errorCode:FailedResource' :: Maybe Text
errorCode = Maybe Text
a} :: FailedResource)
failedResource_errorMessage :: Lens.Lens' FailedResource (Prelude.Maybe Prelude.Text)
failedResource_errorMessage :: (Maybe Text -> f (Maybe Text))
-> FailedResource -> f FailedResource
failedResource_errorMessage = (FailedResource -> Maybe Text)
-> (FailedResource -> Maybe Text -> FailedResource)
-> Lens FailedResource FailedResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedResource' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:FailedResource' :: FailedResource -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: FailedResource
s@FailedResource' {} Maybe Text
a -> FailedResource
s {$sel:errorMessage:FailedResource' :: Maybe Text
errorMessage = Maybe Text
a} :: FailedResource)
instance Core.FromJSON FailedResource where
parseJSON :: Value -> Parser FailedResource
parseJSON =
String
-> (Object -> Parser FailedResource)
-> Value
-> Parser FailedResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FailedResource"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> FailedResource
FailedResource'
(Maybe Text -> Maybe Text -> Maybe Text -> FailedResource)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> FailedResource)
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
"ResourceArn")
Parser (Maybe Text -> Maybe Text -> FailedResource)
-> Parser (Maybe Text) -> Parser (Maybe Text -> FailedResource)
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
"ErrorCode")
Parser (Maybe Text -> FailedResource)
-> Parser (Maybe Text) -> Parser FailedResource
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
"ErrorMessage")
)
instance Prelude.Hashable FailedResource
instance Prelude.NFData FailedResource