{-# 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.DeletionTaskFailureReasonType where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.RoleUsageType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DeletionTaskFailureReasonType = DeletionTaskFailureReasonType'
{
DeletionTaskFailureReasonType -> Maybe [RoleUsageType]
roleUsageList :: Prelude.Maybe [RoleUsageType],
DeletionTaskFailureReasonType -> Maybe Text
reason :: Prelude.Maybe Prelude.Text
}
deriving (DeletionTaskFailureReasonType
-> DeletionTaskFailureReasonType -> Bool
(DeletionTaskFailureReasonType
-> DeletionTaskFailureReasonType -> Bool)
-> (DeletionTaskFailureReasonType
-> DeletionTaskFailureReasonType -> Bool)
-> Eq DeletionTaskFailureReasonType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletionTaskFailureReasonType
-> DeletionTaskFailureReasonType -> Bool
$c/= :: DeletionTaskFailureReasonType
-> DeletionTaskFailureReasonType -> Bool
== :: DeletionTaskFailureReasonType
-> DeletionTaskFailureReasonType -> Bool
$c== :: DeletionTaskFailureReasonType
-> DeletionTaskFailureReasonType -> Bool
Prelude.Eq, ReadPrec [DeletionTaskFailureReasonType]
ReadPrec DeletionTaskFailureReasonType
Int -> ReadS DeletionTaskFailureReasonType
ReadS [DeletionTaskFailureReasonType]
(Int -> ReadS DeletionTaskFailureReasonType)
-> ReadS [DeletionTaskFailureReasonType]
-> ReadPrec DeletionTaskFailureReasonType
-> ReadPrec [DeletionTaskFailureReasonType]
-> Read DeletionTaskFailureReasonType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletionTaskFailureReasonType]
$creadListPrec :: ReadPrec [DeletionTaskFailureReasonType]
readPrec :: ReadPrec DeletionTaskFailureReasonType
$creadPrec :: ReadPrec DeletionTaskFailureReasonType
readList :: ReadS [DeletionTaskFailureReasonType]
$creadList :: ReadS [DeletionTaskFailureReasonType]
readsPrec :: Int -> ReadS DeletionTaskFailureReasonType
$creadsPrec :: Int -> ReadS DeletionTaskFailureReasonType
Prelude.Read, Int -> DeletionTaskFailureReasonType -> ShowS
[DeletionTaskFailureReasonType] -> ShowS
DeletionTaskFailureReasonType -> String
(Int -> DeletionTaskFailureReasonType -> ShowS)
-> (DeletionTaskFailureReasonType -> String)
-> ([DeletionTaskFailureReasonType] -> ShowS)
-> Show DeletionTaskFailureReasonType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletionTaskFailureReasonType] -> ShowS
$cshowList :: [DeletionTaskFailureReasonType] -> ShowS
show :: DeletionTaskFailureReasonType -> String
$cshow :: DeletionTaskFailureReasonType -> String
showsPrec :: Int -> DeletionTaskFailureReasonType -> ShowS
$cshowsPrec :: Int -> DeletionTaskFailureReasonType -> ShowS
Prelude.Show, (forall x.
DeletionTaskFailureReasonType
-> Rep DeletionTaskFailureReasonType x)
-> (forall x.
Rep DeletionTaskFailureReasonType x
-> DeletionTaskFailureReasonType)
-> Generic DeletionTaskFailureReasonType
forall x.
Rep DeletionTaskFailureReasonType x
-> DeletionTaskFailureReasonType
forall x.
DeletionTaskFailureReasonType
-> Rep DeletionTaskFailureReasonType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeletionTaskFailureReasonType x
-> DeletionTaskFailureReasonType
$cfrom :: forall x.
DeletionTaskFailureReasonType
-> Rep DeletionTaskFailureReasonType x
Prelude.Generic)
newDeletionTaskFailureReasonType ::
DeletionTaskFailureReasonType
newDeletionTaskFailureReasonType :: DeletionTaskFailureReasonType
newDeletionTaskFailureReasonType =
DeletionTaskFailureReasonType' :: Maybe [RoleUsageType]
-> Maybe Text -> DeletionTaskFailureReasonType
DeletionTaskFailureReasonType'
{ $sel:roleUsageList:DeletionTaskFailureReasonType' :: Maybe [RoleUsageType]
roleUsageList =
Maybe [RoleUsageType]
forall a. Maybe a
Prelude.Nothing,
$sel:reason:DeletionTaskFailureReasonType' :: Maybe Text
reason = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deletionTaskFailureReasonType_roleUsageList :: Lens.Lens' DeletionTaskFailureReasonType (Prelude.Maybe [RoleUsageType])
deletionTaskFailureReasonType_roleUsageList :: (Maybe [RoleUsageType] -> f (Maybe [RoleUsageType]))
-> DeletionTaskFailureReasonType -> f DeletionTaskFailureReasonType
deletionTaskFailureReasonType_roleUsageList = (DeletionTaskFailureReasonType -> Maybe [RoleUsageType])
-> (DeletionTaskFailureReasonType
-> Maybe [RoleUsageType] -> DeletionTaskFailureReasonType)
-> Lens
DeletionTaskFailureReasonType
DeletionTaskFailureReasonType
(Maybe [RoleUsageType])
(Maybe [RoleUsageType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletionTaskFailureReasonType' {Maybe [RoleUsageType]
roleUsageList :: Maybe [RoleUsageType]
$sel:roleUsageList:DeletionTaskFailureReasonType' :: DeletionTaskFailureReasonType -> Maybe [RoleUsageType]
roleUsageList} -> Maybe [RoleUsageType]
roleUsageList) (\s :: DeletionTaskFailureReasonType
s@DeletionTaskFailureReasonType' {} Maybe [RoleUsageType]
a -> DeletionTaskFailureReasonType
s {$sel:roleUsageList:DeletionTaskFailureReasonType' :: Maybe [RoleUsageType]
roleUsageList = Maybe [RoleUsageType]
a} :: DeletionTaskFailureReasonType) ((Maybe [RoleUsageType] -> f (Maybe [RoleUsageType]))
-> DeletionTaskFailureReasonType
-> f DeletionTaskFailureReasonType)
-> ((Maybe [RoleUsageType] -> f (Maybe [RoleUsageType]))
-> Maybe [RoleUsageType] -> f (Maybe [RoleUsageType]))
-> (Maybe [RoleUsageType] -> f (Maybe [RoleUsageType]))
-> DeletionTaskFailureReasonType
-> f DeletionTaskFailureReasonType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RoleUsageType] [RoleUsageType] [RoleUsageType] [RoleUsageType]
-> Iso
(Maybe [RoleUsageType])
(Maybe [RoleUsageType])
(Maybe [RoleUsageType])
(Maybe [RoleUsageType])
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
[RoleUsageType] [RoleUsageType] [RoleUsageType] [RoleUsageType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deletionTaskFailureReasonType_reason :: Lens.Lens' DeletionTaskFailureReasonType (Prelude.Maybe Prelude.Text)
deletionTaskFailureReasonType_reason :: (Maybe Text -> f (Maybe Text))
-> DeletionTaskFailureReasonType -> f DeletionTaskFailureReasonType
deletionTaskFailureReasonType_reason = (DeletionTaskFailureReasonType -> Maybe Text)
-> (DeletionTaskFailureReasonType
-> Maybe Text -> DeletionTaskFailureReasonType)
-> Lens
DeletionTaskFailureReasonType
DeletionTaskFailureReasonType
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletionTaskFailureReasonType' {Maybe Text
reason :: Maybe Text
$sel:reason:DeletionTaskFailureReasonType' :: DeletionTaskFailureReasonType -> Maybe Text
reason} -> Maybe Text
reason) (\s :: DeletionTaskFailureReasonType
s@DeletionTaskFailureReasonType' {} Maybe Text
a -> DeletionTaskFailureReasonType
s {$sel:reason:DeletionTaskFailureReasonType' :: Maybe Text
reason = Maybe Text
a} :: DeletionTaskFailureReasonType)
instance Core.FromXML DeletionTaskFailureReasonType where
parseXML :: [Node] -> Either String DeletionTaskFailureReasonType
parseXML [Node]
x =
Maybe [RoleUsageType]
-> Maybe Text -> DeletionTaskFailureReasonType
DeletionTaskFailureReasonType'
(Maybe [RoleUsageType]
-> Maybe Text -> DeletionTaskFailureReasonType)
-> Either String (Maybe [RoleUsageType])
-> Either String (Maybe Text -> DeletionTaskFailureReasonType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RoleUsageList" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [RoleUsageType]))
-> Either String (Maybe [RoleUsageType])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [RoleUsageType])
-> [Node] -> Either String (Maybe [RoleUsageType])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [RoleUsageType]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either String (Maybe Text -> DeletionTaskFailureReasonType)
-> Either String (Maybe Text)
-> Either String DeletionTaskFailureReasonType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Reason")
instance
Prelude.Hashable
DeletionTaskFailureReasonType
instance Prelude.NFData DeletionTaskFailureReasonType