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