{-# 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.IAM.Types.ErrorDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ErrorDetails = ErrorDetails'
{
ErrorDetails -> Text
message :: Prelude.Text,
ErrorDetails -> Text
code :: Prelude.Text
}
deriving (ErrorDetails -> ErrorDetails -> Bool
(ErrorDetails -> ErrorDetails -> Bool)
-> (ErrorDetails -> ErrorDetails -> Bool) -> Eq ErrorDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ErrorDetails -> ErrorDetails -> Bool
$c/= :: ErrorDetails -> ErrorDetails -> Bool
== :: ErrorDetails -> ErrorDetails -> Bool
$c== :: ErrorDetails -> ErrorDetails -> Bool
Prelude.Eq, ReadPrec [ErrorDetails]
ReadPrec ErrorDetails
Int -> ReadS ErrorDetails
ReadS [ErrorDetails]
(Int -> ReadS ErrorDetails)
-> ReadS [ErrorDetails]
-> ReadPrec ErrorDetails
-> ReadPrec [ErrorDetails]
-> Read ErrorDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ErrorDetails]
$creadListPrec :: ReadPrec [ErrorDetails]
readPrec :: ReadPrec ErrorDetails
$creadPrec :: ReadPrec ErrorDetails
readList :: ReadS [ErrorDetails]
$creadList :: ReadS [ErrorDetails]
readsPrec :: Int -> ReadS ErrorDetails
$creadsPrec :: Int -> ReadS ErrorDetails
Prelude.Read, Int -> ErrorDetails -> ShowS
[ErrorDetails] -> ShowS
ErrorDetails -> String
(Int -> ErrorDetails -> ShowS)
-> (ErrorDetails -> String)
-> ([ErrorDetails] -> ShowS)
-> Show ErrorDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ErrorDetails] -> ShowS
$cshowList :: [ErrorDetails] -> ShowS
show :: ErrorDetails -> String
$cshow :: ErrorDetails -> String
showsPrec :: Int -> ErrorDetails -> ShowS
$cshowsPrec :: Int -> ErrorDetails -> ShowS
Prelude.Show, (forall x. ErrorDetails -> Rep ErrorDetails x)
-> (forall x. Rep ErrorDetails x -> ErrorDetails)
-> Generic ErrorDetails
forall x. Rep ErrorDetails x -> ErrorDetails
forall x. ErrorDetails -> Rep ErrorDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ErrorDetails x -> ErrorDetails
$cfrom :: forall x. ErrorDetails -> Rep ErrorDetails x
Prelude.Generic)
newErrorDetails ::
Prelude.Text ->
Prelude.Text ->
ErrorDetails
newErrorDetails :: Text -> Text -> ErrorDetails
newErrorDetails Text
pMessage_ Text
pCode_ =
ErrorDetails' :: Text -> Text -> ErrorDetails
ErrorDetails' {$sel:message:ErrorDetails' :: Text
message = Text
pMessage_, $sel:code:ErrorDetails' :: Text
code = Text
pCode_}
errorDetails_message :: Lens.Lens' ErrorDetails Prelude.Text
errorDetails_message :: (Text -> f Text) -> ErrorDetails -> f ErrorDetails
errorDetails_message = (ErrorDetails -> Text)
-> (ErrorDetails -> Text -> ErrorDetails)
-> Lens ErrorDetails ErrorDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorDetails' {Text
message :: Text
$sel:message:ErrorDetails' :: ErrorDetails -> Text
message} -> Text
message) (\s :: ErrorDetails
s@ErrorDetails' {} Text
a -> ErrorDetails
s {$sel:message:ErrorDetails' :: Text
message = Text
a} :: ErrorDetails)
errorDetails_code :: Lens.Lens' ErrorDetails Prelude.Text
errorDetails_code :: (Text -> f Text) -> ErrorDetails -> f ErrorDetails
errorDetails_code = (ErrorDetails -> Text)
-> (ErrorDetails -> Text -> ErrorDetails)
-> Lens ErrorDetails ErrorDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorDetails' {Text
code :: Text
$sel:code:ErrorDetails' :: ErrorDetails -> Text
code} -> Text
code) (\s :: ErrorDetails
s@ErrorDetails' {} Text
a -> ErrorDetails
s {$sel:code:ErrorDetails' :: Text
code = Text
a} :: ErrorDetails)
instance Core.FromXML ErrorDetails where
parseXML :: [Node] -> Either String ErrorDetails
parseXML [Node]
x =
Text -> Text -> ErrorDetails
ErrorDetails'
(Text -> Text -> ErrorDetails)
-> Either String Text -> Either String (Text -> ErrorDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Message") Either String (Text -> ErrorDetails)
-> Either String Text -> Either String ErrorDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Code")
instance Prelude.Hashable ErrorDetails
instance Prelude.NFData ErrorDetails