{-# 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.Inspector.Types.FindingFilter
-- 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.Inspector.Types.FindingFilter where

import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types.Attribute
import Amazonka.Inspector.Types.Severity
import Amazonka.Inspector.Types.TimestampRange
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | This data type is used as a request parameter in the ListFindings
-- action.
--
-- /See:/ 'newFindingFilter' smart constructor.
data FindingFilter = FindingFilter'
  { -- | For a record to match a filter, one of the values that is specified for
    -- this data type property must be the exact match of the value of the
    -- __agentId__ property of the Finding data type.
    FindingFilter -> Maybe [Text]
agentIds :: Prelude.Maybe [Prelude.Text],
    -- | For a record to match a filter, one of the values that is specified for
    -- this data type property must be the exact match of the value of the
    -- __ruleName__ property of the Finding data type.
    FindingFilter -> Maybe [Text]
ruleNames :: Prelude.Maybe [Prelude.Text],
    -- | For a record to match a filter, the value that is specified for this
    -- data type property must be contained in the list of values of the
    -- __userAttributes__ property of the Finding data type.
    FindingFilter -> Maybe [Attribute]
userAttributes :: Prelude.Maybe [Attribute],
    -- | For a record to match a filter, one of the values that is specified for
    -- this data type property must be the exact match of the value of the
    -- __rulesPackageArn__ property of the Finding data type.
    FindingFilter -> Maybe [Text]
rulesPackageArns :: Prelude.Maybe [Prelude.Text],
    -- | For a record to match a filter, the list of values that are specified
    -- for this data type property must be contained in the list of values of
    -- the __attributes__ property of the Finding data type.
    FindingFilter -> Maybe [Attribute]
attributes :: Prelude.Maybe [Attribute],
    -- | For a record to match a filter, one of the values that is specified for
    -- this data type property must be the exact match of the value of the
    -- __severity__ property of the Finding data type.
    FindingFilter -> Maybe [Severity]
severities :: Prelude.Maybe [Severity],
    -- | The time range during which the finding is generated.
    FindingFilter -> Maybe TimestampRange
creationTimeRange :: Prelude.Maybe TimestampRange,
    -- | For a record to match a filter, one of the values that is specified for
    -- this data type property must be the exact match of the value of the
    -- __autoScalingGroup__ property of the Finding data type.
    FindingFilter -> Maybe [Text]
autoScalingGroups :: Prelude.Maybe [Prelude.Text]
  }
  deriving (FindingFilter -> FindingFilter -> Bool
(FindingFilter -> FindingFilter -> Bool)
-> (FindingFilter -> FindingFilter -> Bool) -> Eq FindingFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FindingFilter -> FindingFilter -> Bool
$c/= :: FindingFilter -> FindingFilter -> Bool
== :: FindingFilter -> FindingFilter -> Bool
$c== :: FindingFilter -> FindingFilter -> Bool
Prelude.Eq, ReadPrec [FindingFilter]
ReadPrec FindingFilter
Int -> ReadS FindingFilter
ReadS [FindingFilter]
(Int -> ReadS FindingFilter)
-> ReadS [FindingFilter]
-> ReadPrec FindingFilter
-> ReadPrec [FindingFilter]
-> Read FindingFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FindingFilter]
$creadListPrec :: ReadPrec [FindingFilter]
readPrec :: ReadPrec FindingFilter
$creadPrec :: ReadPrec FindingFilter
readList :: ReadS [FindingFilter]
$creadList :: ReadS [FindingFilter]
readsPrec :: Int -> ReadS FindingFilter
$creadsPrec :: Int -> ReadS FindingFilter
Prelude.Read, Int -> FindingFilter -> ShowS
[FindingFilter] -> ShowS
FindingFilter -> String
(Int -> FindingFilter -> ShowS)
-> (FindingFilter -> String)
-> ([FindingFilter] -> ShowS)
-> Show FindingFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FindingFilter] -> ShowS
$cshowList :: [FindingFilter] -> ShowS
show :: FindingFilter -> String
$cshow :: FindingFilter -> String
showsPrec :: Int -> FindingFilter -> ShowS
$cshowsPrec :: Int -> FindingFilter -> ShowS
Prelude.Show, (forall x. FindingFilter -> Rep FindingFilter x)
-> (forall x. Rep FindingFilter x -> FindingFilter)
-> Generic FindingFilter
forall x. Rep FindingFilter x -> FindingFilter
forall x. FindingFilter -> Rep FindingFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FindingFilter x -> FindingFilter
$cfrom :: forall x. FindingFilter -> Rep FindingFilter x
Prelude.Generic)

-- |
-- Create a value of 'FindingFilter' 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:
--
-- 'agentIds', 'findingFilter_agentIds' - For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __agentId__ property of the Finding data type.
--
-- 'ruleNames', 'findingFilter_ruleNames' - For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __ruleName__ property of the Finding data type.
--
-- 'userAttributes', 'findingFilter_userAttributes' - For a record to match a filter, the value that is specified for this
-- data type property must be contained in the list of values of the
-- __userAttributes__ property of the Finding data type.
--
-- 'rulesPackageArns', 'findingFilter_rulesPackageArns' - For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __rulesPackageArn__ property of the Finding data type.
--
-- 'attributes', 'findingFilter_attributes' - For a record to match a filter, the list of values that are specified
-- for this data type property must be contained in the list of values of
-- the __attributes__ property of the Finding data type.
--
-- 'severities', 'findingFilter_severities' - For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __severity__ property of the Finding data type.
--
-- 'creationTimeRange', 'findingFilter_creationTimeRange' - The time range during which the finding is generated.
--
-- 'autoScalingGroups', 'findingFilter_autoScalingGroups' - For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __autoScalingGroup__ property of the Finding data type.
newFindingFilter ::
  FindingFilter
newFindingFilter :: FindingFilter
newFindingFilter =
  FindingFilter' :: Maybe [Text]
-> Maybe [Text]
-> Maybe [Attribute]
-> Maybe [Text]
-> Maybe [Attribute]
-> Maybe [Severity]
-> Maybe TimestampRange
-> Maybe [Text]
-> FindingFilter
FindingFilter'
    { $sel:agentIds:FindingFilter' :: Maybe [Text]
agentIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:ruleNames:FindingFilter' :: Maybe [Text]
ruleNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:userAttributes:FindingFilter' :: Maybe [Attribute]
userAttributes = Maybe [Attribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:rulesPackageArns:FindingFilter' :: Maybe [Text]
rulesPackageArns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:FindingFilter' :: Maybe [Attribute]
attributes = Maybe [Attribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:severities:FindingFilter' :: Maybe [Severity]
severities = Maybe [Severity]
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeRange:FindingFilter' :: Maybe TimestampRange
creationTimeRange = Maybe TimestampRange
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingGroups:FindingFilter' :: Maybe [Text]
autoScalingGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __agentId__ property of the Finding data type.
findingFilter_agentIds :: Lens.Lens' FindingFilter (Prelude.Maybe [Prelude.Text])
findingFilter_agentIds :: (Maybe [Text] -> f (Maybe [Text]))
-> FindingFilter -> f FindingFilter
findingFilter_agentIds = (FindingFilter -> Maybe [Text])
-> (FindingFilter -> Maybe [Text] -> FindingFilter)
-> Lens FindingFilter FindingFilter (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingFilter' {Maybe [Text]
agentIds :: Maybe [Text]
$sel:agentIds:FindingFilter' :: FindingFilter -> Maybe [Text]
agentIds} -> Maybe [Text]
agentIds) (\s :: FindingFilter
s@FindingFilter' {} Maybe [Text]
a -> FindingFilter
s {$sel:agentIds:FindingFilter' :: Maybe [Text]
agentIds = Maybe [Text]
a} :: FindingFilter) ((Maybe [Text] -> f (Maybe [Text]))
 -> FindingFilter -> f FindingFilter)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> FindingFilter
-> f FindingFilter
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

-- | For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __ruleName__ property of the Finding data type.
findingFilter_ruleNames :: Lens.Lens' FindingFilter (Prelude.Maybe [Prelude.Text])
findingFilter_ruleNames :: (Maybe [Text] -> f (Maybe [Text]))
-> FindingFilter -> f FindingFilter
findingFilter_ruleNames = (FindingFilter -> Maybe [Text])
-> (FindingFilter -> Maybe [Text] -> FindingFilter)
-> Lens FindingFilter FindingFilter (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingFilter' {Maybe [Text]
ruleNames :: Maybe [Text]
$sel:ruleNames:FindingFilter' :: FindingFilter -> Maybe [Text]
ruleNames} -> Maybe [Text]
ruleNames) (\s :: FindingFilter
s@FindingFilter' {} Maybe [Text]
a -> FindingFilter
s {$sel:ruleNames:FindingFilter' :: Maybe [Text]
ruleNames = Maybe [Text]
a} :: FindingFilter) ((Maybe [Text] -> f (Maybe [Text]))
 -> FindingFilter -> f FindingFilter)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> FindingFilter
-> f FindingFilter
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

-- | For a record to match a filter, the value that is specified for this
-- data type property must be contained in the list of values of the
-- __userAttributes__ property of the Finding data type.
findingFilter_userAttributes :: Lens.Lens' FindingFilter (Prelude.Maybe [Attribute])
findingFilter_userAttributes :: (Maybe [Attribute] -> f (Maybe [Attribute]))
-> FindingFilter -> f FindingFilter
findingFilter_userAttributes = (FindingFilter -> Maybe [Attribute])
-> (FindingFilter -> Maybe [Attribute] -> FindingFilter)
-> Lens
     FindingFilter FindingFilter (Maybe [Attribute]) (Maybe [Attribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingFilter' {Maybe [Attribute]
userAttributes :: Maybe [Attribute]
$sel:userAttributes:FindingFilter' :: FindingFilter -> Maybe [Attribute]
userAttributes} -> Maybe [Attribute]
userAttributes) (\s :: FindingFilter
s@FindingFilter' {} Maybe [Attribute]
a -> FindingFilter
s {$sel:userAttributes:FindingFilter' :: Maybe [Attribute]
userAttributes = Maybe [Attribute]
a} :: FindingFilter) ((Maybe [Attribute] -> f (Maybe [Attribute]))
 -> FindingFilter -> f FindingFilter)
-> ((Maybe [Attribute] -> f (Maybe [Attribute]))
    -> Maybe [Attribute] -> f (Maybe [Attribute]))
-> (Maybe [Attribute] -> f (Maybe [Attribute]))
-> FindingFilter
-> f FindingFilter
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attribute] [Attribute] [Attribute] [Attribute]
-> Iso
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
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 [Attribute] [Attribute] [Attribute] [Attribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __rulesPackageArn__ property of the Finding data type.
findingFilter_rulesPackageArns :: Lens.Lens' FindingFilter (Prelude.Maybe [Prelude.Text])
findingFilter_rulesPackageArns :: (Maybe [Text] -> f (Maybe [Text]))
-> FindingFilter -> f FindingFilter
findingFilter_rulesPackageArns = (FindingFilter -> Maybe [Text])
-> (FindingFilter -> Maybe [Text] -> FindingFilter)
-> Lens FindingFilter FindingFilter (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingFilter' {Maybe [Text]
rulesPackageArns :: Maybe [Text]
$sel:rulesPackageArns:FindingFilter' :: FindingFilter -> Maybe [Text]
rulesPackageArns} -> Maybe [Text]
rulesPackageArns) (\s :: FindingFilter
s@FindingFilter' {} Maybe [Text]
a -> FindingFilter
s {$sel:rulesPackageArns:FindingFilter' :: Maybe [Text]
rulesPackageArns = Maybe [Text]
a} :: FindingFilter) ((Maybe [Text] -> f (Maybe [Text]))
 -> FindingFilter -> f FindingFilter)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> FindingFilter
-> f FindingFilter
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

-- | For a record to match a filter, the list of values that are specified
-- for this data type property must be contained in the list of values of
-- the __attributes__ property of the Finding data type.
findingFilter_attributes :: Lens.Lens' FindingFilter (Prelude.Maybe [Attribute])
findingFilter_attributes :: (Maybe [Attribute] -> f (Maybe [Attribute]))
-> FindingFilter -> f FindingFilter
findingFilter_attributes = (FindingFilter -> Maybe [Attribute])
-> (FindingFilter -> Maybe [Attribute] -> FindingFilter)
-> Lens
     FindingFilter FindingFilter (Maybe [Attribute]) (Maybe [Attribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingFilter' {Maybe [Attribute]
attributes :: Maybe [Attribute]
$sel:attributes:FindingFilter' :: FindingFilter -> Maybe [Attribute]
attributes} -> Maybe [Attribute]
attributes) (\s :: FindingFilter
s@FindingFilter' {} Maybe [Attribute]
a -> FindingFilter
s {$sel:attributes:FindingFilter' :: Maybe [Attribute]
attributes = Maybe [Attribute]
a} :: FindingFilter) ((Maybe [Attribute] -> f (Maybe [Attribute]))
 -> FindingFilter -> f FindingFilter)
-> ((Maybe [Attribute] -> f (Maybe [Attribute]))
    -> Maybe [Attribute] -> f (Maybe [Attribute]))
-> (Maybe [Attribute] -> f (Maybe [Attribute]))
-> FindingFilter
-> f FindingFilter
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attribute] [Attribute] [Attribute] [Attribute]
-> Iso
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
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 [Attribute] [Attribute] [Attribute] [Attribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __severity__ property of the Finding data type.
findingFilter_severities :: Lens.Lens' FindingFilter (Prelude.Maybe [Severity])
findingFilter_severities :: (Maybe [Severity] -> f (Maybe [Severity]))
-> FindingFilter -> f FindingFilter
findingFilter_severities = (FindingFilter -> Maybe [Severity])
-> (FindingFilter -> Maybe [Severity] -> FindingFilter)
-> Lens
     FindingFilter FindingFilter (Maybe [Severity]) (Maybe [Severity])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingFilter' {Maybe [Severity]
severities :: Maybe [Severity]
$sel:severities:FindingFilter' :: FindingFilter -> Maybe [Severity]
severities} -> Maybe [Severity]
severities) (\s :: FindingFilter
s@FindingFilter' {} Maybe [Severity]
a -> FindingFilter
s {$sel:severities:FindingFilter' :: Maybe [Severity]
severities = Maybe [Severity]
a} :: FindingFilter) ((Maybe [Severity] -> f (Maybe [Severity]))
 -> FindingFilter -> f FindingFilter)
-> ((Maybe [Severity] -> f (Maybe [Severity]))
    -> Maybe [Severity] -> f (Maybe [Severity]))
-> (Maybe [Severity] -> f (Maybe [Severity]))
-> FindingFilter
-> f FindingFilter
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Severity] [Severity] [Severity] [Severity]
-> Iso
     (Maybe [Severity])
     (Maybe [Severity])
     (Maybe [Severity])
     (Maybe [Severity])
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 [Severity] [Severity] [Severity] [Severity]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time range during which the finding is generated.
findingFilter_creationTimeRange :: Lens.Lens' FindingFilter (Prelude.Maybe TimestampRange)
findingFilter_creationTimeRange :: (Maybe TimestampRange -> f (Maybe TimestampRange))
-> FindingFilter -> f FindingFilter
findingFilter_creationTimeRange = (FindingFilter -> Maybe TimestampRange)
-> (FindingFilter -> Maybe TimestampRange -> FindingFilter)
-> Lens
     FindingFilter
     FindingFilter
     (Maybe TimestampRange)
     (Maybe TimestampRange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingFilter' {Maybe TimestampRange
creationTimeRange :: Maybe TimestampRange
$sel:creationTimeRange:FindingFilter' :: FindingFilter -> Maybe TimestampRange
creationTimeRange} -> Maybe TimestampRange
creationTimeRange) (\s :: FindingFilter
s@FindingFilter' {} Maybe TimestampRange
a -> FindingFilter
s {$sel:creationTimeRange:FindingFilter' :: Maybe TimestampRange
creationTimeRange = Maybe TimestampRange
a} :: FindingFilter)

-- | For a record to match a filter, one of the values that is specified for
-- this data type property must be the exact match of the value of the
-- __autoScalingGroup__ property of the Finding data type.
findingFilter_autoScalingGroups :: Lens.Lens' FindingFilter (Prelude.Maybe [Prelude.Text])
findingFilter_autoScalingGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> FindingFilter -> f FindingFilter
findingFilter_autoScalingGroups = (FindingFilter -> Maybe [Text])
-> (FindingFilter -> Maybe [Text] -> FindingFilter)
-> Lens FindingFilter FindingFilter (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingFilter' {Maybe [Text]
autoScalingGroups :: Maybe [Text]
$sel:autoScalingGroups:FindingFilter' :: FindingFilter -> Maybe [Text]
autoScalingGroups} -> Maybe [Text]
autoScalingGroups) (\s :: FindingFilter
s@FindingFilter' {} Maybe [Text]
a -> FindingFilter
s {$sel:autoScalingGroups:FindingFilter' :: Maybe [Text]
autoScalingGroups = Maybe [Text]
a} :: FindingFilter) ((Maybe [Text] -> f (Maybe [Text]))
 -> FindingFilter -> f FindingFilter)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> FindingFilter
-> f FindingFilter
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

instance Prelude.Hashable FindingFilter

instance Prelude.NFData FindingFilter

instance Core.ToJSON FindingFilter where
  toJSON :: FindingFilter -> Value
toJSON FindingFilter' {Maybe [Text]
Maybe [Attribute]
Maybe [Severity]
Maybe TimestampRange
autoScalingGroups :: Maybe [Text]
creationTimeRange :: Maybe TimestampRange
severities :: Maybe [Severity]
attributes :: Maybe [Attribute]
rulesPackageArns :: Maybe [Text]
userAttributes :: Maybe [Attribute]
ruleNames :: Maybe [Text]
agentIds :: Maybe [Text]
$sel:autoScalingGroups:FindingFilter' :: FindingFilter -> Maybe [Text]
$sel:creationTimeRange:FindingFilter' :: FindingFilter -> Maybe TimestampRange
$sel:severities:FindingFilter' :: FindingFilter -> Maybe [Severity]
$sel:attributes:FindingFilter' :: FindingFilter -> Maybe [Attribute]
$sel:rulesPackageArns:FindingFilter' :: FindingFilter -> Maybe [Text]
$sel:userAttributes:FindingFilter' :: FindingFilter -> Maybe [Attribute]
$sel:ruleNames:FindingFilter' :: FindingFilter -> Maybe [Text]
$sel:agentIds:FindingFilter' :: FindingFilter -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"agentIds" 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]
agentIds,
            (Text
"ruleNames" 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]
ruleNames,
            (Text
"userAttributes" Text -> [Attribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Attribute] -> Pair) -> Maybe [Attribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Attribute]
userAttributes,
            (Text
"rulesPackageArns" 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]
rulesPackageArns,
            (Text
"attributes" Text -> [Attribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Attribute] -> Pair) -> Maybe [Attribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Attribute]
attributes,
            (Text
"severities" Text -> [Severity] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Severity] -> Pair) -> Maybe [Severity] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Severity]
severities,
            (Text
"creationTimeRange" Text -> TimestampRange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TimestampRange -> Pair) -> Maybe TimestampRange -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TimestampRange
creationTimeRange,
            (Text
"autoScalingGroups" 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]
autoScalingGroups
          ]
      )