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