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