{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Config.Types.OrganizationCustomRuleMetadata
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Config.Types.OrganizationCustomRuleMetadata where

import Amazonka.Config.Types.MaximumExecutionFrequency
import Amazonka.Config.Types.OrganizationConfigRuleTriggerType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object that specifies organization custom rule metadata such as
-- resource type, resource ID of Amazon Web Services resource, Lambda
-- function ARN, and organization trigger types that trigger Config to
-- evaluate your Amazon Web Services resources against a rule. It also
-- provides the frequency with which you want Config to run evaluations for
-- the rule if the trigger type is periodic.
--
-- /See:/ 'newOrganizationCustomRuleMetadata' smart constructor.
data OrganizationCustomRuleMetadata = OrganizationCustomRuleMetadata'
  { -- | A string, in JSON format, that is passed to organization config rule
    -- Lambda function.
    OrganizationCustomRuleMetadata -> Maybe Text
inputParameters :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services resource that was evaluated.
    OrganizationCustomRuleMetadata -> Maybe Text
resourceIdScope :: Prelude.Maybe Prelude.Text,
    -- | The optional part of a key-value pair that make up a tag. A value acts
    -- as a descriptor within a tag category (key).
    OrganizationCustomRuleMetadata -> Maybe Text
tagValueScope :: Prelude.Maybe Prelude.Text,
    -- | The maximum frequency with which Config runs evaluations for a rule.
    -- Your custom rule is triggered when Config delivers the configuration
    -- snapshot. For more information, see ConfigSnapshotDeliveryProperties.
    --
    -- By default, rules with a periodic trigger are evaluated every 24 hours.
    -- To change the frequency, specify a valid value for the
    -- @MaximumExecutionFrequency@ parameter.
    OrganizationCustomRuleMetadata -> Maybe MaximumExecutionFrequency
maximumExecutionFrequency :: Prelude.Maybe MaximumExecutionFrequency,
    -- | One part of a key-value pair that make up a tag. A key is a general
    -- label that acts like a category for more specific tag values.
    OrganizationCustomRuleMetadata -> Maybe Text
tagKeyScope :: Prelude.Maybe Prelude.Text,
    -- | The type of the Amazon Web Services resource that was evaluated.
    OrganizationCustomRuleMetadata -> Maybe [Text]
resourceTypesScope :: Prelude.Maybe [Prelude.Text],
    -- | The description that you provide for organization config rule.
    OrganizationCustomRuleMetadata -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The lambda function ARN.
    OrganizationCustomRuleMetadata -> Text
lambdaFunctionArn :: Prelude.Text,
    -- | The type of notification that triggers Config to run an evaluation for a
    -- rule. You can specify the following notification types:
    --
    -- -   @ConfigurationItemChangeNotification@ - Triggers an evaluation when
    --     Config delivers a configuration item as a result of a resource
    --     change.
    --
    -- -   @OversizedConfigurationItemChangeNotification@ - Triggers an
    --     evaluation when Config delivers an oversized configuration item.
    --     Config may generate this notification type when a resource changes
    --     and the notification exceeds the maximum size allowed by Amazon SNS.
    --
    -- -   @ScheduledNotification@ - Triggers a periodic evaluation at the
    --     frequency specified for @MaximumExecutionFrequency@.
    OrganizationCustomRuleMetadata
-> [OrganizationConfigRuleTriggerType]
organizationConfigRuleTriggerTypes :: [OrganizationConfigRuleTriggerType]
  }
  deriving (OrganizationCustomRuleMetadata
-> OrganizationCustomRuleMetadata -> Bool
(OrganizationCustomRuleMetadata
 -> OrganizationCustomRuleMetadata -> Bool)
-> (OrganizationCustomRuleMetadata
    -> OrganizationCustomRuleMetadata -> Bool)
-> Eq OrganizationCustomRuleMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrganizationCustomRuleMetadata
-> OrganizationCustomRuleMetadata -> Bool
$c/= :: OrganizationCustomRuleMetadata
-> OrganizationCustomRuleMetadata -> Bool
== :: OrganizationCustomRuleMetadata
-> OrganizationCustomRuleMetadata -> Bool
$c== :: OrganizationCustomRuleMetadata
-> OrganizationCustomRuleMetadata -> Bool
Prelude.Eq, ReadPrec [OrganizationCustomRuleMetadata]
ReadPrec OrganizationCustomRuleMetadata
Int -> ReadS OrganizationCustomRuleMetadata
ReadS [OrganizationCustomRuleMetadata]
(Int -> ReadS OrganizationCustomRuleMetadata)
-> ReadS [OrganizationCustomRuleMetadata]
-> ReadPrec OrganizationCustomRuleMetadata
-> ReadPrec [OrganizationCustomRuleMetadata]
-> Read OrganizationCustomRuleMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OrganizationCustomRuleMetadata]
$creadListPrec :: ReadPrec [OrganizationCustomRuleMetadata]
readPrec :: ReadPrec OrganizationCustomRuleMetadata
$creadPrec :: ReadPrec OrganizationCustomRuleMetadata
readList :: ReadS [OrganizationCustomRuleMetadata]
$creadList :: ReadS [OrganizationCustomRuleMetadata]
readsPrec :: Int -> ReadS OrganizationCustomRuleMetadata
$creadsPrec :: Int -> ReadS OrganizationCustomRuleMetadata
Prelude.Read, Int -> OrganizationCustomRuleMetadata -> ShowS
[OrganizationCustomRuleMetadata] -> ShowS
OrganizationCustomRuleMetadata -> String
(Int -> OrganizationCustomRuleMetadata -> ShowS)
-> (OrganizationCustomRuleMetadata -> String)
-> ([OrganizationCustomRuleMetadata] -> ShowS)
-> Show OrganizationCustomRuleMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrganizationCustomRuleMetadata] -> ShowS
$cshowList :: [OrganizationCustomRuleMetadata] -> ShowS
show :: OrganizationCustomRuleMetadata -> String
$cshow :: OrganizationCustomRuleMetadata -> String
showsPrec :: Int -> OrganizationCustomRuleMetadata -> ShowS
$cshowsPrec :: Int -> OrganizationCustomRuleMetadata -> ShowS
Prelude.Show, (forall x.
 OrganizationCustomRuleMetadata
 -> Rep OrganizationCustomRuleMetadata x)
-> (forall x.
    Rep OrganizationCustomRuleMetadata x
    -> OrganizationCustomRuleMetadata)
-> Generic OrganizationCustomRuleMetadata
forall x.
Rep OrganizationCustomRuleMetadata x
-> OrganizationCustomRuleMetadata
forall x.
OrganizationCustomRuleMetadata
-> Rep OrganizationCustomRuleMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OrganizationCustomRuleMetadata x
-> OrganizationCustomRuleMetadata
$cfrom :: forall x.
OrganizationCustomRuleMetadata
-> Rep OrganizationCustomRuleMetadata x
Prelude.Generic)

-- |
-- Create a value of 'OrganizationCustomRuleMetadata' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'inputParameters', 'organizationCustomRuleMetadata_inputParameters' - A string, in JSON format, that is passed to organization config rule
-- Lambda function.
--
-- 'resourceIdScope', 'organizationCustomRuleMetadata_resourceIdScope' - The ID of the Amazon Web Services resource that was evaluated.
--
-- 'tagValueScope', 'organizationCustomRuleMetadata_tagValueScope' - The optional part of a key-value pair that make up a tag. A value acts
-- as a descriptor within a tag category (key).
--
-- 'maximumExecutionFrequency', 'organizationCustomRuleMetadata_maximumExecutionFrequency' - The maximum frequency with which Config runs evaluations for a rule.
-- Your custom rule is triggered when Config delivers the configuration
-- snapshot. For more information, see ConfigSnapshotDeliveryProperties.
--
-- By default, rules with a periodic trigger are evaluated every 24 hours.
-- To change the frequency, specify a valid value for the
-- @MaximumExecutionFrequency@ parameter.
--
-- 'tagKeyScope', 'organizationCustomRuleMetadata_tagKeyScope' - One part of a key-value pair that make up a tag. A key is a general
-- label that acts like a category for more specific tag values.
--
-- 'resourceTypesScope', 'organizationCustomRuleMetadata_resourceTypesScope' - The type of the Amazon Web Services resource that was evaluated.
--
-- 'description', 'organizationCustomRuleMetadata_description' - The description that you provide for organization config rule.
--
-- 'lambdaFunctionArn', 'organizationCustomRuleMetadata_lambdaFunctionArn' - The lambda function ARN.
--
-- 'organizationConfigRuleTriggerTypes', 'organizationCustomRuleMetadata_organizationConfigRuleTriggerTypes' - The type of notification that triggers Config to run an evaluation for a
-- rule. You can specify the following notification types:
--
-- -   @ConfigurationItemChangeNotification@ - Triggers an evaluation when
--     Config delivers a configuration item as a result of a resource
--     change.
--
-- -   @OversizedConfigurationItemChangeNotification@ - Triggers an
--     evaluation when Config delivers an oversized configuration item.
--     Config may generate this notification type when a resource changes
--     and the notification exceeds the maximum size allowed by Amazon SNS.
--
-- -   @ScheduledNotification@ - Triggers a periodic evaluation at the
--     frequency specified for @MaximumExecutionFrequency@.
newOrganizationCustomRuleMetadata ::
  -- | 'lambdaFunctionArn'
  Prelude.Text ->
  OrganizationCustomRuleMetadata
newOrganizationCustomRuleMetadata :: Text -> OrganizationCustomRuleMetadata
newOrganizationCustomRuleMetadata Text
pLambdaFunctionArn_ =
  OrganizationCustomRuleMetadata' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe MaximumExecutionFrequency
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Text
-> [OrganizationConfigRuleTriggerType]
-> OrganizationCustomRuleMetadata
OrganizationCustomRuleMetadata'
    { $sel:inputParameters:OrganizationCustomRuleMetadata' :: Maybe Text
inputParameters =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceIdScope:OrganizationCustomRuleMetadata' :: Maybe Text
resourceIdScope = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tagValueScope:OrganizationCustomRuleMetadata' :: Maybe Text
tagValueScope = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maximumExecutionFrequency:OrganizationCustomRuleMetadata' :: Maybe MaximumExecutionFrequency
maximumExecutionFrequency = Maybe MaximumExecutionFrequency
forall a. Maybe a
Prelude.Nothing,
      $sel:tagKeyScope:OrganizationCustomRuleMetadata' :: Maybe Text
tagKeyScope = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceTypesScope:OrganizationCustomRuleMetadata' :: Maybe [Text]
resourceTypesScope = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:OrganizationCustomRuleMetadata' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaFunctionArn:OrganizationCustomRuleMetadata' :: Text
lambdaFunctionArn = Text
pLambdaFunctionArn_,
      $sel:organizationConfigRuleTriggerTypes:OrganizationCustomRuleMetadata' :: [OrganizationConfigRuleTriggerType]
organizationConfigRuleTriggerTypes =
        [OrganizationConfigRuleTriggerType]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A string, in JSON format, that is passed to organization config rule
-- Lambda function.
organizationCustomRuleMetadata_inputParameters :: Lens.Lens' OrganizationCustomRuleMetadata (Prelude.Maybe Prelude.Text)
organizationCustomRuleMetadata_inputParameters :: (Maybe Text -> f (Maybe Text))
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
organizationCustomRuleMetadata_inputParameters = (OrganizationCustomRuleMetadata -> Maybe Text)
-> (OrganizationCustomRuleMetadata
    -> Maybe Text -> OrganizationCustomRuleMetadata)
-> Lens
     OrganizationCustomRuleMetadata
     OrganizationCustomRuleMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationCustomRuleMetadata' {Maybe Text
inputParameters :: Maybe Text
$sel:inputParameters:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
inputParameters} -> Maybe Text
inputParameters) (\s :: OrganizationCustomRuleMetadata
s@OrganizationCustomRuleMetadata' {} Maybe Text
a -> OrganizationCustomRuleMetadata
s {$sel:inputParameters:OrganizationCustomRuleMetadata' :: Maybe Text
inputParameters = Maybe Text
a} :: OrganizationCustomRuleMetadata)

-- | The ID of the Amazon Web Services resource that was evaluated.
organizationCustomRuleMetadata_resourceIdScope :: Lens.Lens' OrganizationCustomRuleMetadata (Prelude.Maybe Prelude.Text)
organizationCustomRuleMetadata_resourceIdScope :: (Maybe Text -> f (Maybe Text))
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
organizationCustomRuleMetadata_resourceIdScope = (OrganizationCustomRuleMetadata -> Maybe Text)
-> (OrganizationCustomRuleMetadata
    -> Maybe Text -> OrganizationCustomRuleMetadata)
-> Lens
     OrganizationCustomRuleMetadata
     OrganizationCustomRuleMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationCustomRuleMetadata' {Maybe Text
resourceIdScope :: Maybe Text
$sel:resourceIdScope:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
resourceIdScope} -> Maybe Text
resourceIdScope) (\s :: OrganizationCustomRuleMetadata
s@OrganizationCustomRuleMetadata' {} Maybe Text
a -> OrganizationCustomRuleMetadata
s {$sel:resourceIdScope:OrganizationCustomRuleMetadata' :: Maybe Text
resourceIdScope = Maybe Text
a} :: OrganizationCustomRuleMetadata)

-- | The optional part of a key-value pair that make up a tag. A value acts
-- as a descriptor within a tag category (key).
organizationCustomRuleMetadata_tagValueScope :: Lens.Lens' OrganizationCustomRuleMetadata (Prelude.Maybe Prelude.Text)
organizationCustomRuleMetadata_tagValueScope :: (Maybe Text -> f (Maybe Text))
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
organizationCustomRuleMetadata_tagValueScope = (OrganizationCustomRuleMetadata -> Maybe Text)
-> (OrganizationCustomRuleMetadata
    -> Maybe Text -> OrganizationCustomRuleMetadata)
-> Lens
     OrganizationCustomRuleMetadata
     OrganizationCustomRuleMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationCustomRuleMetadata' {Maybe Text
tagValueScope :: Maybe Text
$sel:tagValueScope:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
tagValueScope} -> Maybe Text
tagValueScope) (\s :: OrganizationCustomRuleMetadata
s@OrganizationCustomRuleMetadata' {} Maybe Text
a -> OrganizationCustomRuleMetadata
s {$sel:tagValueScope:OrganizationCustomRuleMetadata' :: Maybe Text
tagValueScope = Maybe Text
a} :: OrganizationCustomRuleMetadata)

-- | The maximum frequency with which Config runs evaluations for a rule.
-- Your custom rule is triggered when Config delivers the configuration
-- snapshot. For more information, see ConfigSnapshotDeliveryProperties.
--
-- By default, rules with a periodic trigger are evaluated every 24 hours.
-- To change the frequency, specify a valid value for the
-- @MaximumExecutionFrequency@ parameter.
organizationCustomRuleMetadata_maximumExecutionFrequency :: Lens.Lens' OrganizationCustomRuleMetadata (Prelude.Maybe MaximumExecutionFrequency)
organizationCustomRuleMetadata_maximumExecutionFrequency :: (Maybe MaximumExecutionFrequency
 -> f (Maybe MaximumExecutionFrequency))
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
organizationCustomRuleMetadata_maximumExecutionFrequency = (OrganizationCustomRuleMetadata -> Maybe MaximumExecutionFrequency)
-> (OrganizationCustomRuleMetadata
    -> Maybe MaximumExecutionFrequency
    -> OrganizationCustomRuleMetadata)
-> Lens
     OrganizationCustomRuleMetadata
     OrganizationCustomRuleMetadata
     (Maybe MaximumExecutionFrequency)
     (Maybe MaximumExecutionFrequency)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationCustomRuleMetadata' {Maybe MaximumExecutionFrequency
maximumExecutionFrequency :: Maybe MaximumExecutionFrequency
$sel:maximumExecutionFrequency:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe MaximumExecutionFrequency
maximumExecutionFrequency} -> Maybe MaximumExecutionFrequency
maximumExecutionFrequency) (\s :: OrganizationCustomRuleMetadata
s@OrganizationCustomRuleMetadata' {} Maybe MaximumExecutionFrequency
a -> OrganizationCustomRuleMetadata
s {$sel:maximumExecutionFrequency:OrganizationCustomRuleMetadata' :: Maybe MaximumExecutionFrequency
maximumExecutionFrequency = Maybe MaximumExecutionFrequency
a} :: OrganizationCustomRuleMetadata)

-- | One part of a key-value pair that make up a tag. A key is a general
-- label that acts like a category for more specific tag values.
organizationCustomRuleMetadata_tagKeyScope :: Lens.Lens' OrganizationCustomRuleMetadata (Prelude.Maybe Prelude.Text)
organizationCustomRuleMetadata_tagKeyScope :: (Maybe Text -> f (Maybe Text))
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
organizationCustomRuleMetadata_tagKeyScope = (OrganizationCustomRuleMetadata -> Maybe Text)
-> (OrganizationCustomRuleMetadata
    -> Maybe Text -> OrganizationCustomRuleMetadata)
-> Lens
     OrganizationCustomRuleMetadata
     OrganizationCustomRuleMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationCustomRuleMetadata' {Maybe Text
tagKeyScope :: Maybe Text
$sel:tagKeyScope:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
tagKeyScope} -> Maybe Text
tagKeyScope) (\s :: OrganizationCustomRuleMetadata
s@OrganizationCustomRuleMetadata' {} Maybe Text
a -> OrganizationCustomRuleMetadata
s {$sel:tagKeyScope:OrganizationCustomRuleMetadata' :: Maybe Text
tagKeyScope = Maybe Text
a} :: OrganizationCustomRuleMetadata)

-- | The type of the Amazon Web Services resource that was evaluated.
organizationCustomRuleMetadata_resourceTypesScope :: Lens.Lens' OrganizationCustomRuleMetadata (Prelude.Maybe [Prelude.Text])
organizationCustomRuleMetadata_resourceTypesScope :: (Maybe [Text] -> f (Maybe [Text]))
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
organizationCustomRuleMetadata_resourceTypesScope = (OrganizationCustomRuleMetadata -> Maybe [Text])
-> (OrganizationCustomRuleMetadata
    -> Maybe [Text] -> OrganizationCustomRuleMetadata)
-> Lens
     OrganizationCustomRuleMetadata
     OrganizationCustomRuleMetadata
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationCustomRuleMetadata' {Maybe [Text]
resourceTypesScope :: Maybe [Text]
$sel:resourceTypesScope:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe [Text]
resourceTypesScope} -> Maybe [Text]
resourceTypesScope) (\s :: OrganizationCustomRuleMetadata
s@OrganizationCustomRuleMetadata' {} Maybe [Text]
a -> OrganizationCustomRuleMetadata
s {$sel:resourceTypesScope:OrganizationCustomRuleMetadata' :: Maybe [Text]
resourceTypesScope = Maybe [Text]
a} :: OrganizationCustomRuleMetadata) ((Maybe [Text] -> f (Maybe [Text]))
 -> OrganizationCustomRuleMetadata
 -> f OrganizationCustomRuleMetadata)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The description that you provide for organization config rule.
organizationCustomRuleMetadata_description :: Lens.Lens' OrganizationCustomRuleMetadata (Prelude.Maybe Prelude.Text)
organizationCustomRuleMetadata_description :: (Maybe Text -> f (Maybe Text))
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
organizationCustomRuleMetadata_description = (OrganizationCustomRuleMetadata -> Maybe Text)
-> (OrganizationCustomRuleMetadata
    -> Maybe Text -> OrganizationCustomRuleMetadata)
-> Lens
     OrganizationCustomRuleMetadata
     OrganizationCustomRuleMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationCustomRuleMetadata' {Maybe Text
description :: Maybe Text
$sel:description:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
description} -> Maybe Text
description) (\s :: OrganizationCustomRuleMetadata
s@OrganizationCustomRuleMetadata' {} Maybe Text
a -> OrganizationCustomRuleMetadata
s {$sel:description:OrganizationCustomRuleMetadata' :: Maybe Text
description = Maybe Text
a} :: OrganizationCustomRuleMetadata)

-- | The lambda function ARN.
organizationCustomRuleMetadata_lambdaFunctionArn :: Lens.Lens' OrganizationCustomRuleMetadata Prelude.Text
organizationCustomRuleMetadata_lambdaFunctionArn :: (Text -> f Text)
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
organizationCustomRuleMetadata_lambdaFunctionArn = (OrganizationCustomRuleMetadata -> Text)
-> (OrganizationCustomRuleMetadata
    -> Text -> OrganizationCustomRuleMetadata)
-> Lens
     OrganizationCustomRuleMetadata
     OrganizationCustomRuleMetadata
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationCustomRuleMetadata' {Text
lambdaFunctionArn :: Text
$sel:lambdaFunctionArn:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Text
lambdaFunctionArn} -> Text
lambdaFunctionArn) (\s :: OrganizationCustomRuleMetadata
s@OrganizationCustomRuleMetadata' {} Text
a -> OrganizationCustomRuleMetadata
s {$sel:lambdaFunctionArn:OrganizationCustomRuleMetadata' :: Text
lambdaFunctionArn = Text
a} :: OrganizationCustomRuleMetadata)

-- | The type of notification that triggers Config to run an evaluation for a
-- rule. You can specify the following notification types:
--
-- -   @ConfigurationItemChangeNotification@ - Triggers an evaluation when
--     Config delivers a configuration item as a result of a resource
--     change.
--
-- -   @OversizedConfigurationItemChangeNotification@ - Triggers an
--     evaluation when Config delivers an oversized configuration item.
--     Config may generate this notification type when a resource changes
--     and the notification exceeds the maximum size allowed by Amazon SNS.
--
-- -   @ScheduledNotification@ - Triggers a periodic evaluation at the
--     frequency specified for @MaximumExecutionFrequency@.
organizationCustomRuleMetadata_organizationConfigRuleTriggerTypes :: Lens.Lens' OrganizationCustomRuleMetadata [OrganizationConfigRuleTriggerType]
organizationCustomRuleMetadata_organizationConfigRuleTriggerTypes :: ([OrganizationConfigRuleTriggerType]
 -> f [OrganizationConfigRuleTriggerType])
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
organizationCustomRuleMetadata_organizationConfigRuleTriggerTypes = (OrganizationCustomRuleMetadata
 -> [OrganizationConfigRuleTriggerType])
-> (OrganizationCustomRuleMetadata
    -> [OrganizationConfigRuleTriggerType]
    -> OrganizationCustomRuleMetadata)
-> Lens
     OrganizationCustomRuleMetadata
     OrganizationCustomRuleMetadata
     [OrganizationConfigRuleTriggerType]
     [OrganizationConfigRuleTriggerType]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationCustomRuleMetadata' {[OrganizationConfigRuleTriggerType]
organizationConfigRuleTriggerTypes :: [OrganizationConfigRuleTriggerType]
$sel:organizationConfigRuleTriggerTypes:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata
-> [OrganizationConfigRuleTriggerType]
organizationConfigRuleTriggerTypes} -> [OrganizationConfigRuleTriggerType]
organizationConfigRuleTriggerTypes) (\s :: OrganizationCustomRuleMetadata
s@OrganizationCustomRuleMetadata' {} [OrganizationConfigRuleTriggerType]
a -> OrganizationCustomRuleMetadata
s {$sel:organizationConfigRuleTriggerTypes:OrganizationCustomRuleMetadata' :: [OrganizationConfigRuleTriggerType]
organizationConfigRuleTriggerTypes = [OrganizationConfigRuleTriggerType]
a} :: OrganizationCustomRuleMetadata) (([OrganizationConfigRuleTriggerType]
  -> f [OrganizationConfigRuleTriggerType])
 -> OrganizationCustomRuleMetadata
 -> f OrganizationCustomRuleMetadata)
-> (([OrganizationConfigRuleTriggerType]
     -> f [OrganizationConfigRuleTriggerType])
    -> [OrganizationConfigRuleTriggerType]
    -> f [OrganizationConfigRuleTriggerType])
-> ([OrganizationConfigRuleTriggerType]
    -> f [OrganizationConfigRuleTriggerType])
-> OrganizationCustomRuleMetadata
-> f OrganizationCustomRuleMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([OrganizationConfigRuleTriggerType]
 -> f [OrganizationConfigRuleTriggerType])
-> [OrganizationConfigRuleTriggerType]
-> f [OrganizationConfigRuleTriggerType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON OrganizationCustomRuleMetadata where
  parseJSON :: Value -> Parser OrganizationCustomRuleMetadata
parseJSON =
    String
-> (Object -> Parser OrganizationCustomRuleMetadata)
-> Value
-> Parser OrganizationCustomRuleMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OrganizationCustomRuleMetadata"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe MaximumExecutionFrequency
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Text
-> [OrganizationConfigRuleTriggerType]
-> OrganizationCustomRuleMetadata
OrganizationCustomRuleMetadata'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe MaximumExecutionFrequency
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Text
 -> [OrganizationConfigRuleTriggerType]
 -> OrganizationCustomRuleMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe MaximumExecutionFrequency
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Text
      -> [OrganizationConfigRuleTriggerType]
      -> OrganizationCustomRuleMetadata)
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
"InputParameters")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe MaximumExecutionFrequency
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Text
   -> [OrganizationConfigRuleTriggerType]
   -> OrganizationCustomRuleMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe MaximumExecutionFrequency
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Text
      -> [OrganizationConfigRuleTriggerType]
      -> OrganizationCustomRuleMetadata)
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
"ResourceIdScope")
            Parser
  (Maybe Text
   -> Maybe MaximumExecutionFrequency
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Text
   -> [OrganizationConfigRuleTriggerType]
   -> OrganizationCustomRuleMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe MaximumExecutionFrequency
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Text
      -> [OrganizationConfigRuleTriggerType]
      -> OrganizationCustomRuleMetadata)
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
"TagValueScope")
            Parser
  (Maybe MaximumExecutionFrequency
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Text
   -> [OrganizationConfigRuleTriggerType]
   -> OrganizationCustomRuleMetadata)
-> Parser (Maybe MaximumExecutionFrequency)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Text
      -> [OrganizationConfigRuleTriggerType]
      -> OrganizationCustomRuleMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MaximumExecutionFrequency)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaximumExecutionFrequency")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Text
   -> [OrganizationConfigRuleTriggerType]
   -> OrganizationCustomRuleMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Text
      -> [OrganizationConfigRuleTriggerType]
      -> OrganizationCustomRuleMetadata)
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
"TagKeyScope")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Text
   -> [OrganizationConfigRuleTriggerType]
   -> OrganizationCustomRuleMetadata)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Text
      -> [OrganizationConfigRuleTriggerType]
      -> OrganizationCustomRuleMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceTypesScope"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Text
   -> [OrganizationConfigRuleTriggerType]
   -> OrganizationCustomRuleMetadata)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> [OrganizationConfigRuleTriggerType]
      -> OrganizationCustomRuleMetadata)
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")
            Parser
  (Text
   -> [OrganizationConfigRuleTriggerType]
   -> OrganizationCustomRuleMetadata)
-> Parser Text
-> Parser
     ([OrganizationConfigRuleTriggerType]
      -> OrganizationCustomRuleMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"LambdaFunctionArn")
            Parser
  ([OrganizationConfigRuleTriggerType]
   -> OrganizationCustomRuleMetadata)
-> Parser [OrganizationConfigRuleTriggerType]
-> Parser OrganizationCustomRuleMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe [OrganizationConfigRuleTriggerType])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OrganizationConfigRuleTriggerTypes"
                            Parser (Maybe [OrganizationConfigRuleTriggerType])
-> [OrganizationConfigRuleTriggerType]
-> Parser [OrganizationConfigRuleTriggerType]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [OrganizationConfigRuleTriggerType]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    OrganizationCustomRuleMetadata

instance
  Prelude.NFData
    OrganizationCustomRuleMetadata

instance Core.ToJSON OrganizationCustomRuleMetadata where
  toJSON :: OrganizationCustomRuleMetadata -> Value
toJSON OrganizationCustomRuleMetadata' {[OrganizationConfigRuleTriggerType]
Maybe [Text]
Maybe Text
Maybe MaximumExecutionFrequency
Text
organizationConfigRuleTriggerTypes :: [OrganizationConfigRuleTriggerType]
lambdaFunctionArn :: Text
description :: Maybe Text
resourceTypesScope :: Maybe [Text]
tagKeyScope :: Maybe Text
maximumExecutionFrequency :: Maybe MaximumExecutionFrequency
tagValueScope :: Maybe Text
resourceIdScope :: Maybe Text
inputParameters :: Maybe Text
$sel:organizationConfigRuleTriggerTypes:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata
-> [OrganizationConfigRuleTriggerType]
$sel:lambdaFunctionArn:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Text
$sel:description:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
$sel:resourceTypesScope:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe [Text]
$sel:tagKeyScope:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
$sel:maximumExecutionFrequency:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe MaximumExecutionFrequency
$sel:tagValueScope:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
$sel:resourceIdScope:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
$sel:inputParameters:OrganizationCustomRuleMetadata' :: OrganizationCustomRuleMetadata -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"InputParameters" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
inputParameters,
            (Text
"ResourceIdScope" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceIdScope,
            (Text
"TagValueScope" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
tagValueScope,
            (Text
"MaximumExecutionFrequency" Text -> MaximumExecutionFrequency -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MaximumExecutionFrequency -> Pair)
-> Maybe MaximumExecutionFrequency -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MaximumExecutionFrequency
maximumExecutionFrequency,
            (Text
"TagKeyScope" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
tagKeyScope,
            (Text
"ResourceTypesScope" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
resourceTypesScope,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"LambdaFunctionArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
lambdaFunctionArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"OrganizationConfigRuleTriggerTypes"
                  Text -> [OrganizationConfigRuleTriggerType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [OrganizationConfigRuleTriggerType]
organizationConfigRuleTriggerTypes
              )
          ]
      )