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