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