{-# 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.AccessAnalyzer.Types.StatusReason where
import Amazonka.AccessAnalyzer.Types.ReasonCode
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StatusReason = StatusReason'
{
StatusReason -> ReasonCode
code :: ReasonCode
}
deriving (StatusReason -> StatusReason -> Bool
(StatusReason -> StatusReason -> Bool)
-> (StatusReason -> StatusReason -> Bool) -> Eq StatusReason
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StatusReason -> StatusReason -> Bool
$c/= :: StatusReason -> StatusReason -> Bool
== :: StatusReason -> StatusReason -> Bool
$c== :: StatusReason -> StatusReason -> Bool
Prelude.Eq, ReadPrec [StatusReason]
ReadPrec StatusReason
Int -> ReadS StatusReason
ReadS [StatusReason]
(Int -> ReadS StatusReason)
-> ReadS [StatusReason]
-> ReadPrec StatusReason
-> ReadPrec [StatusReason]
-> Read StatusReason
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StatusReason]
$creadListPrec :: ReadPrec [StatusReason]
readPrec :: ReadPrec StatusReason
$creadPrec :: ReadPrec StatusReason
readList :: ReadS [StatusReason]
$creadList :: ReadS [StatusReason]
readsPrec :: Int -> ReadS StatusReason
$creadsPrec :: Int -> ReadS StatusReason
Prelude.Read, Int -> StatusReason -> ShowS
[StatusReason] -> ShowS
StatusReason -> String
(Int -> StatusReason -> ShowS)
-> (StatusReason -> String)
-> ([StatusReason] -> ShowS)
-> Show StatusReason
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StatusReason] -> ShowS
$cshowList :: [StatusReason] -> ShowS
show :: StatusReason -> String
$cshow :: StatusReason -> String
showsPrec :: Int -> StatusReason -> ShowS
$cshowsPrec :: Int -> StatusReason -> ShowS
Prelude.Show, (forall x. StatusReason -> Rep StatusReason x)
-> (forall x. Rep StatusReason x -> StatusReason)
-> Generic StatusReason
forall x. Rep StatusReason x -> StatusReason
forall x. StatusReason -> Rep StatusReason x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StatusReason x -> StatusReason
$cfrom :: forall x. StatusReason -> Rep StatusReason x
Prelude.Generic)
newStatusReason ::
ReasonCode ->
StatusReason
newStatusReason :: ReasonCode -> StatusReason
newStatusReason ReasonCode
pCode_ = StatusReason' :: ReasonCode -> StatusReason
StatusReason' {$sel:code:StatusReason' :: ReasonCode
code = ReasonCode
pCode_}
statusReason_code :: Lens.Lens' StatusReason ReasonCode
statusReason_code :: (ReasonCode -> f ReasonCode) -> StatusReason -> f StatusReason
statusReason_code = (StatusReason -> ReasonCode)
-> (StatusReason -> ReasonCode -> StatusReason)
-> Lens StatusReason StatusReason ReasonCode ReasonCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StatusReason' {ReasonCode
code :: ReasonCode
$sel:code:StatusReason' :: StatusReason -> ReasonCode
code} -> ReasonCode
code) (\s :: StatusReason
s@StatusReason' {} ReasonCode
a -> StatusReason
s {$sel:code:StatusReason' :: ReasonCode
code = ReasonCode
a} :: StatusReason)
instance Core.FromJSON StatusReason where
parseJSON :: Value -> Parser StatusReason
parseJSON =
String
-> (Object -> Parser StatusReason) -> Value -> Parser StatusReason
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StatusReason"
(\Object
x -> ReasonCode -> StatusReason
StatusReason' (ReasonCode -> StatusReason)
-> Parser ReasonCode -> Parser StatusReason
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser ReasonCode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"code"))
instance Prelude.Hashable StatusReason
instance Prelude.NFData StatusReason