{-# 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.Config.Types.OrganizationConfigRule where
import Amazonka.Config.Types.OrganizationCustomPolicyRuleMetadataNoPolicy
import Amazonka.Config.Types.OrganizationCustomRuleMetadata
import Amazonka.Config.Types.OrganizationManagedRuleMetadata
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data OrganizationConfigRule = OrganizationConfigRule'
{
OrganizationConfigRule -> Maybe [Text]
excludedAccounts :: Prelude.Maybe [Prelude.Text],
OrganizationConfigRule -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Data.POSIX,
OrganizationConfigRule
-> Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
organizationCustomPolicyRuleMetadata :: Prelude.Maybe OrganizationCustomPolicyRuleMetadataNoPolicy,
OrganizationConfigRule -> Maybe OrganizationCustomRuleMetadata
organizationCustomRuleMetadata :: Prelude.Maybe OrganizationCustomRuleMetadata,
OrganizationConfigRule -> Maybe OrganizationManagedRuleMetadata
organizationManagedRuleMetadata :: Prelude.Maybe OrganizationManagedRuleMetadata,
OrganizationConfigRule -> Text
organizationConfigRuleName :: Prelude.Text,
OrganizationConfigRule -> Text
organizationConfigRuleArn :: Prelude.Text
}
deriving (OrganizationConfigRule -> OrganizationConfigRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrganizationConfigRule -> OrganizationConfigRule -> Bool
$c/= :: OrganizationConfigRule -> OrganizationConfigRule -> Bool
== :: OrganizationConfigRule -> OrganizationConfigRule -> Bool
$c== :: OrganizationConfigRule -> OrganizationConfigRule -> Bool
Prelude.Eq, ReadPrec [OrganizationConfigRule]
ReadPrec OrganizationConfigRule
Int -> ReadS OrganizationConfigRule
ReadS [OrganizationConfigRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OrganizationConfigRule]
$creadListPrec :: ReadPrec [OrganizationConfigRule]
readPrec :: ReadPrec OrganizationConfigRule
$creadPrec :: ReadPrec OrganizationConfigRule
readList :: ReadS [OrganizationConfigRule]
$creadList :: ReadS [OrganizationConfigRule]
readsPrec :: Int -> ReadS OrganizationConfigRule
$creadsPrec :: Int -> ReadS OrganizationConfigRule
Prelude.Read, Int -> OrganizationConfigRule -> ShowS
[OrganizationConfigRule] -> ShowS
OrganizationConfigRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrganizationConfigRule] -> ShowS
$cshowList :: [OrganizationConfigRule] -> ShowS
show :: OrganizationConfigRule -> String
$cshow :: OrganizationConfigRule -> String
showsPrec :: Int -> OrganizationConfigRule -> ShowS
$cshowsPrec :: Int -> OrganizationConfigRule -> ShowS
Prelude.Show, forall x. Rep OrganizationConfigRule x -> OrganizationConfigRule
forall x. OrganizationConfigRule -> Rep OrganizationConfigRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OrganizationConfigRule x -> OrganizationConfigRule
$cfrom :: forall x. OrganizationConfigRule -> Rep OrganizationConfigRule x
Prelude.Generic)
newOrganizationConfigRule ::
Prelude.Text ->
Prelude.Text ->
OrganizationConfigRule
newOrganizationConfigRule :: Text -> Text -> OrganizationConfigRule
newOrganizationConfigRule
Text
pOrganizationConfigRuleName_
Text
pOrganizationConfigRuleArn_ =
OrganizationConfigRule'
{ $sel:excludedAccounts:OrganizationConfigRule' :: Maybe [Text]
excludedAccounts =
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdateTime:OrganizationConfigRule' :: Maybe POSIX
lastUpdateTime = forall a. Maybe a
Prelude.Nothing,
$sel:organizationCustomPolicyRuleMetadata:OrganizationConfigRule' :: Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
organizationCustomPolicyRuleMetadata =
forall a. Maybe a
Prelude.Nothing,
$sel:organizationCustomRuleMetadata:OrganizationConfigRule' :: Maybe OrganizationCustomRuleMetadata
organizationCustomRuleMetadata = forall a. Maybe a
Prelude.Nothing,
$sel:organizationManagedRuleMetadata:OrganizationConfigRule' :: Maybe OrganizationManagedRuleMetadata
organizationManagedRuleMetadata = forall a. Maybe a
Prelude.Nothing,
$sel:organizationConfigRuleName:OrganizationConfigRule' :: Text
organizationConfigRuleName =
Text
pOrganizationConfigRuleName_,
$sel:organizationConfigRuleArn:OrganizationConfigRule' :: Text
organizationConfigRuleArn =
Text
pOrganizationConfigRuleArn_
}
organizationConfigRule_excludedAccounts :: Lens.Lens' OrganizationConfigRule (Prelude.Maybe [Prelude.Text])
organizationConfigRule_excludedAccounts :: Lens' OrganizationConfigRule (Maybe [Text])
organizationConfigRule_excludedAccounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationConfigRule' {Maybe [Text]
excludedAccounts :: Maybe [Text]
$sel:excludedAccounts:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe [Text]
excludedAccounts} -> Maybe [Text]
excludedAccounts) (\s :: OrganizationConfigRule
s@OrganizationConfigRule' {} Maybe [Text]
a -> OrganizationConfigRule
s {$sel:excludedAccounts:OrganizationConfigRule' :: Maybe [Text]
excludedAccounts = Maybe [Text]
a} :: OrganizationConfigRule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
organizationConfigRule_lastUpdateTime :: Lens.Lens' OrganizationConfigRule (Prelude.Maybe Prelude.UTCTime)
organizationConfigRule_lastUpdateTime :: Lens' OrganizationConfigRule (Maybe UTCTime)
organizationConfigRule_lastUpdateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationConfigRule' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: OrganizationConfigRule
s@OrganizationConfigRule' {} Maybe POSIX
a -> OrganizationConfigRule
s {$sel:lastUpdateTime:OrganizationConfigRule' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: OrganizationConfigRule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
organizationConfigRule_organizationCustomPolicyRuleMetadata :: Lens.Lens' OrganizationConfigRule (Prelude.Maybe OrganizationCustomPolicyRuleMetadataNoPolicy)
organizationConfigRule_organizationCustomPolicyRuleMetadata :: Lens'
OrganizationConfigRule
(Maybe OrganizationCustomPolicyRuleMetadataNoPolicy)
organizationConfigRule_organizationCustomPolicyRuleMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationConfigRule' {Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
organizationCustomPolicyRuleMetadata :: Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
$sel:organizationCustomPolicyRuleMetadata:OrganizationConfigRule' :: OrganizationConfigRule
-> Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
organizationCustomPolicyRuleMetadata} -> Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
organizationCustomPolicyRuleMetadata) (\s :: OrganizationConfigRule
s@OrganizationConfigRule' {} Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
a -> OrganizationConfigRule
s {$sel:organizationCustomPolicyRuleMetadata:OrganizationConfigRule' :: Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
organizationCustomPolicyRuleMetadata = Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
a} :: OrganizationConfigRule)
organizationConfigRule_organizationCustomRuleMetadata :: Lens.Lens' OrganizationConfigRule (Prelude.Maybe OrganizationCustomRuleMetadata)
organizationConfigRule_organizationCustomRuleMetadata :: Lens' OrganizationConfigRule (Maybe OrganizationCustomRuleMetadata)
organizationConfigRule_organizationCustomRuleMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationConfigRule' {Maybe OrganizationCustomRuleMetadata
organizationCustomRuleMetadata :: Maybe OrganizationCustomRuleMetadata
$sel:organizationCustomRuleMetadata:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe OrganizationCustomRuleMetadata
organizationCustomRuleMetadata} -> Maybe OrganizationCustomRuleMetadata
organizationCustomRuleMetadata) (\s :: OrganizationConfigRule
s@OrganizationConfigRule' {} Maybe OrganizationCustomRuleMetadata
a -> OrganizationConfigRule
s {$sel:organizationCustomRuleMetadata:OrganizationConfigRule' :: Maybe OrganizationCustomRuleMetadata
organizationCustomRuleMetadata = Maybe OrganizationCustomRuleMetadata
a} :: OrganizationConfigRule)
organizationConfigRule_organizationManagedRuleMetadata :: Lens.Lens' OrganizationConfigRule (Prelude.Maybe OrganizationManagedRuleMetadata)
organizationConfigRule_organizationManagedRuleMetadata :: Lens'
OrganizationConfigRule (Maybe OrganizationManagedRuleMetadata)
organizationConfigRule_organizationManagedRuleMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationConfigRule' {Maybe OrganizationManagedRuleMetadata
organizationManagedRuleMetadata :: Maybe OrganizationManagedRuleMetadata
$sel:organizationManagedRuleMetadata:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe OrganizationManagedRuleMetadata
organizationManagedRuleMetadata} -> Maybe OrganizationManagedRuleMetadata
organizationManagedRuleMetadata) (\s :: OrganizationConfigRule
s@OrganizationConfigRule' {} Maybe OrganizationManagedRuleMetadata
a -> OrganizationConfigRule
s {$sel:organizationManagedRuleMetadata:OrganizationConfigRule' :: Maybe OrganizationManagedRuleMetadata
organizationManagedRuleMetadata = Maybe OrganizationManagedRuleMetadata
a} :: OrganizationConfigRule)
organizationConfigRule_organizationConfigRuleName :: Lens.Lens' OrganizationConfigRule Prelude.Text
organizationConfigRule_organizationConfigRuleName :: Lens' OrganizationConfigRule Text
organizationConfigRule_organizationConfigRuleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationConfigRule' {Text
organizationConfigRuleName :: Text
$sel:organizationConfigRuleName:OrganizationConfigRule' :: OrganizationConfigRule -> Text
organizationConfigRuleName} -> Text
organizationConfigRuleName) (\s :: OrganizationConfigRule
s@OrganizationConfigRule' {} Text
a -> OrganizationConfigRule
s {$sel:organizationConfigRuleName:OrganizationConfigRule' :: Text
organizationConfigRuleName = Text
a} :: OrganizationConfigRule)
organizationConfigRule_organizationConfigRuleArn :: Lens.Lens' OrganizationConfigRule Prelude.Text
organizationConfigRule_organizationConfigRuleArn :: Lens' OrganizationConfigRule Text
organizationConfigRule_organizationConfigRuleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationConfigRule' {Text
organizationConfigRuleArn :: Text
$sel:organizationConfigRuleArn:OrganizationConfigRule' :: OrganizationConfigRule -> Text
organizationConfigRuleArn} -> Text
organizationConfigRuleArn) (\s :: OrganizationConfigRule
s@OrganizationConfigRule' {} Text
a -> OrganizationConfigRule
s {$sel:organizationConfigRuleArn:OrganizationConfigRule' :: Text
organizationConfigRuleArn = Text
a} :: OrganizationConfigRule)
instance Data.FromJSON OrganizationConfigRule where
parseJSON :: Value -> Parser OrganizationConfigRule
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OrganizationConfigRule"
( \Object
x ->
Maybe [Text]
-> Maybe POSIX
-> Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
-> Maybe OrganizationCustomRuleMetadata
-> Maybe OrganizationManagedRuleMetadata
-> Text
-> Text
-> OrganizationConfigRule
OrganizationConfigRule'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ExcludedAccounts"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastUpdateTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OrganizationCustomPolicyRuleMetadata")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OrganizationCustomRuleMetadata")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OrganizationManagedRuleMetadata")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OrganizationConfigRuleName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OrganizationConfigRuleArn")
)
instance Prelude.Hashable OrganizationConfigRule where
hashWithSalt :: Int -> OrganizationConfigRule -> Int
hashWithSalt Int
_salt OrganizationConfigRule' {Maybe [Text]
Maybe POSIX
Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
Maybe OrganizationCustomRuleMetadata
Maybe OrganizationManagedRuleMetadata
Text
organizationConfigRuleArn :: Text
organizationConfigRuleName :: Text
organizationManagedRuleMetadata :: Maybe OrganizationManagedRuleMetadata
organizationCustomRuleMetadata :: Maybe OrganizationCustomRuleMetadata
organizationCustomPolicyRuleMetadata :: Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
lastUpdateTime :: Maybe POSIX
excludedAccounts :: Maybe [Text]
$sel:organizationConfigRuleArn:OrganizationConfigRule' :: OrganizationConfigRule -> Text
$sel:organizationConfigRuleName:OrganizationConfigRule' :: OrganizationConfigRule -> Text
$sel:organizationManagedRuleMetadata:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe OrganizationManagedRuleMetadata
$sel:organizationCustomRuleMetadata:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe OrganizationCustomRuleMetadata
$sel:organizationCustomPolicyRuleMetadata:OrganizationConfigRule' :: OrganizationConfigRule
-> Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
$sel:lastUpdateTime:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe POSIX
$sel:excludedAccounts:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
excludedAccounts
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdateTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
organizationCustomPolicyRuleMetadata
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OrganizationCustomRuleMetadata
organizationCustomRuleMetadata
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OrganizationManagedRuleMetadata
organizationManagedRuleMetadata
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationConfigRuleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationConfigRuleArn
instance Prelude.NFData OrganizationConfigRule where
rnf :: OrganizationConfigRule -> ()
rnf OrganizationConfigRule' {Maybe [Text]
Maybe POSIX
Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
Maybe OrganizationCustomRuleMetadata
Maybe OrganizationManagedRuleMetadata
Text
organizationConfigRuleArn :: Text
organizationConfigRuleName :: Text
organizationManagedRuleMetadata :: Maybe OrganizationManagedRuleMetadata
organizationCustomRuleMetadata :: Maybe OrganizationCustomRuleMetadata
organizationCustomPolicyRuleMetadata :: Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
lastUpdateTime :: Maybe POSIX
excludedAccounts :: Maybe [Text]
$sel:organizationConfigRuleArn:OrganizationConfigRule' :: OrganizationConfigRule -> Text
$sel:organizationConfigRuleName:OrganizationConfigRule' :: OrganizationConfigRule -> Text
$sel:organizationManagedRuleMetadata:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe OrganizationManagedRuleMetadata
$sel:organizationCustomRuleMetadata:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe OrganizationCustomRuleMetadata
$sel:organizationCustomPolicyRuleMetadata:OrganizationConfigRule' :: OrganizationConfigRule
-> Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
$sel:lastUpdateTime:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe POSIX
$sel:excludedAccounts:OrganizationConfigRule' :: OrganizationConfigRule -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
excludedAccounts
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdateTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OrganizationCustomPolicyRuleMetadataNoPolicy
organizationCustomPolicyRuleMetadata
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OrganizationCustomRuleMetadata
organizationCustomRuleMetadata
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OrganizationManagedRuleMetadata
organizationManagedRuleMetadata
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
organizationConfigRuleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
organizationConfigRuleArn