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