{-# 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.PolicySummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Organizations.Types.PolicyType
import qualified Amazonka.Prelude as Prelude
data PolicySummary = PolicySummary'
{
PolicySummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
PolicySummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
PolicySummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
PolicySummary -> Maybe Bool
awsManaged :: Prelude.Maybe Prelude.Bool,
PolicySummary -> Maybe PolicyType
type' :: Prelude.Maybe PolicyType,
PolicySummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (PolicySummary -> PolicySummary -> Bool
(PolicySummary -> PolicySummary -> Bool)
-> (PolicySummary -> PolicySummary -> Bool) -> Eq PolicySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicySummary -> PolicySummary -> Bool
$c/= :: PolicySummary -> PolicySummary -> Bool
== :: PolicySummary -> PolicySummary -> Bool
$c== :: PolicySummary -> PolicySummary -> Bool
Prelude.Eq, ReadPrec [PolicySummary]
ReadPrec PolicySummary
Int -> ReadS PolicySummary
ReadS [PolicySummary]
(Int -> ReadS PolicySummary)
-> ReadS [PolicySummary]
-> ReadPrec PolicySummary
-> ReadPrec [PolicySummary]
-> Read PolicySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicySummary]
$creadListPrec :: ReadPrec [PolicySummary]
readPrec :: ReadPrec PolicySummary
$creadPrec :: ReadPrec PolicySummary
readList :: ReadS [PolicySummary]
$creadList :: ReadS [PolicySummary]
readsPrec :: Int -> ReadS PolicySummary
$creadsPrec :: Int -> ReadS PolicySummary
Prelude.Read, Int -> PolicySummary -> ShowS
[PolicySummary] -> ShowS
PolicySummary -> String
(Int -> PolicySummary -> ShowS)
-> (PolicySummary -> String)
-> ([PolicySummary] -> ShowS)
-> Show PolicySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicySummary] -> ShowS
$cshowList :: [PolicySummary] -> ShowS
show :: PolicySummary -> String
$cshow :: PolicySummary -> String
showsPrec :: Int -> PolicySummary -> ShowS
$cshowsPrec :: Int -> PolicySummary -> ShowS
Prelude.Show, (forall x. PolicySummary -> Rep PolicySummary x)
-> (forall x. Rep PolicySummary x -> PolicySummary)
-> Generic PolicySummary
forall x. Rep PolicySummary x -> PolicySummary
forall x. PolicySummary -> Rep PolicySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicySummary x -> PolicySummary
$cfrom :: forall x. PolicySummary -> Rep PolicySummary x
Prelude.Generic)
newPolicySummary ::
PolicySummary
newPolicySummary :: PolicySummary
newPolicySummary =
PolicySummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe PolicyType
-> Maybe Text
-> PolicySummary
PolicySummary'
{ $sel:arn:PolicySummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:PolicySummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:PolicySummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:awsManaged:PolicySummary' :: Maybe Bool
awsManaged = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:type':PolicySummary' :: Maybe PolicyType
type' = Maybe PolicyType
forall a. Maybe a
Prelude.Nothing,
$sel:description:PolicySummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
policySummary_arn :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Text)
policySummary_arn :: (Maybe Text -> f (Maybe Text)) -> PolicySummary -> f PolicySummary
policySummary_arn = (PolicySummary -> Maybe Text)
-> (PolicySummary -> Maybe Text -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Text
arn :: Maybe Text
$sel:arn:PolicySummary' :: PolicySummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: PolicySummary
s@PolicySummary' {} Maybe Text
a -> PolicySummary
s {$sel:arn:PolicySummary' :: Maybe Text
arn = Maybe Text
a} :: PolicySummary)
policySummary_name :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Text)
policySummary_name :: (Maybe Text -> f (Maybe Text)) -> PolicySummary -> f PolicySummary
policySummary_name = (PolicySummary -> Maybe Text)
-> (PolicySummary -> Maybe Text -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Text
name :: Maybe Text
$sel:name:PolicySummary' :: PolicySummary -> Maybe Text
name} -> Maybe Text
name) (\s :: PolicySummary
s@PolicySummary' {} Maybe Text
a -> PolicySummary
s {$sel:name:PolicySummary' :: Maybe Text
name = Maybe Text
a} :: PolicySummary)
policySummary_id :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Text)
policySummary_id :: (Maybe Text -> f (Maybe Text)) -> PolicySummary -> f PolicySummary
policySummary_id = (PolicySummary -> Maybe Text)
-> (PolicySummary -> Maybe Text -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Text
id :: Maybe Text
$sel:id:PolicySummary' :: PolicySummary -> Maybe Text
id} -> Maybe Text
id) (\s :: PolicySummary
s@PolicySummary' {} Maybe Text
a -> PolicySummary
s {$sel:id:PolicySummary' :: Maybe Text
id = Maybe Text
a} :: PolicySummary)
policySummary_awsManaged :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Bool)
policySummary_awsManaged :: (Maybe Bool -> f (Maybe Bool)) -> PolicySummary -> f PolicySummary
policySummary_awsManaged = (PolicySummary -> Maybe Bool)
-> (PolicySummary -> Maybe Bool -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Bool
awsManaged :: Maybe Bool
$sel:awsManaged:PolicySummary' :: PolicySummary -> Maybe Bool
awsManaged} -> Maybe Bool
awsManaged) (\s :: PolicySummary
s@PolicySummary' {} Maybe Bool
a -> PolicySummary
s {$sel:awsManaged:PolicySummary' :: Maybe Bool
awsManaged = Maybe Bool
a} :: PolicySummary)
policySummary_type :: Lens.Lens' PolicySummary (Prelude.Maybe PolicyType)
policySummary_type :: (Maybe PolicyType -> f (Maybe PolicyType))
-> PolicySummary -> f PolicySummary
policySummary_type = (PolicySummary -> Maybe PolicyType)
-> (PolicySummary -> Maybe PolicyType -> PolicySummary)
-> Lens
PolicySummary PolicySummary (Maybe PolicyType) (Maybe PolicyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe PolicyType
type' :: Maybe PolicyType
$sel:type':PolicySummary' :: PolicySummary -> Maybe PolicyType
type'} -> Maybe PolicyType
type') (\s :: PolicySummary
s@PolicySummary' {} Maybe PolicyType
a -> PolicySummary
s {$sel:type':PolicySummary' :: Maybe PolicyType
type' = Maybe PolicyType
a} :: PolicySummary)
policySummary_description :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Text)
policySummary_description :: (Maybe Text -> f (Maybe Text)) -> PolicySummary -> f PolicySummary
policySummary_description = (PolicySummary -> Maybe Text)
-> (PolicySummary -> Maybe Text -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Text
description :: Maybe Text
$sel:description:PolicySummary' :: PolicySummary -> Maybe Text
description} -> Maybe Text
description) (\s :: PolicySummary
s@PolicySummary' {} Maybe Text
a -> PolicySummary
s {$sel:description:PolicySummary' :: Maybe Text
description = Maybe Text
a} :: PolicySummary)
instance Core.FromJSON PolicySummary where
parseJSON :: Value -> Parser PolicySummary
parseJSON =
String
-> (Object -> Parser PolicySummary)
-> Value
-> Parser PolicySummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PolicySummary"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe PolicyType
-> Maybe Text
-> PolicySummary
PolicySummary'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe PolicyType
-> Maybe Text
-> PolicySummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe PolicyType
-> Maybe Text
-> PolicySummary)
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
"Arn")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe PolicyType
-> Maybe Text
-> PolicySummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Bool -> Maybe PolicyType -> Maybe Text -> PolicySummary)
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 Text
-> Maybe Bool -> Maybe PolicyType -> Maybe Text -> PolicySummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool -> Maybe PolicyType -> Maybe Text -> PolicySummary)
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
"Id")
Parser
(Maybe Bool -> Maybe PolicyType -> Maybe Text -> PolicySummary)
-> Parser (Maybe Bool)
-> Parser (Maybe PolicyType -> Maybe Text -> PolicySummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AwsManaged")
Parser (Maybe PolicyType -> Maybe Text -> PolicySummary)
-> Parser (Maybe PolicyType)
-> Parser (Maybe Text -> PolicySummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PolicyType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Text -> PolicySummary)
-> Parser (Maybe Text) -> Parser PolicySummary
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
"Description")
)
instance Prelude.Hashable PolicySummary
instance Prelude.NFData PolicySummary