module Stratosphere.InspectorV2.Filter (
module Exports, Filter(..), mkFilter
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.InspectorV2.Filter.FilterCriteriaProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Filter
=
Filter {Filter -> ()
haddock_workaround_ :: (),
Filter -> Maybe (Value Text)
description :: (Prelude.Maybe (Value Prelude.Text)),
Filter -> Value Text
filterAction :: (Value Prelude.Text),
Filter -> FilterCriteriaProperty
filterCriteria :: FilterCriteriaProperty,
Filter -> Value Text
name :: (Value Prelude.Text),
Filter -> Maybe (Map Text (Value Text))
tags :: (Prelude.Maybe (Prelude.Map Prelude.Text (Value Prelude.Text)))}
deriving stock (Filter -> Filter -> Bool
(Filter -> Filter -> Bool)
-> (Filter -> Filter -> Bool) -> Eq Filter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Filter -> Filter -> Bool
== :: Filter -> Filter -> Bool
$c/= :: Filter -> Filter -> Bool
/= :: Filter -> Filter -> Bool
Prelude.Eq, Int -> Filter -> ShowS
[Filter] -> ShowS
Filter -> String
(Int -> Filter -> ShowS)
-> (Filter -> String) -> ([Filter] -> ShowS) -> Show Filter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Filter -> ShowS
showsPrec :: Int -> Filter -> ShowS
$cshow :: Filter -> String
show :: Filter -> String
$cshowList :: [Filter] -> ShowS
showList :: [Filter] -> ShowS
Prelude.Show)
mkFilter ::
Value Prelude.Text
-> FilterCriteriaProperty -> Value Prelude.Text -> Filter
mkFilter :: Value Text -> FilterCriteriaProperty -> Value Text -> Filter
mkFilter Value Text
filterAction FilterCriteriaProperty
filterCriteria Value Text
name
= Filter
{haddock_workaround_ :: ()
haddock_workaround_ = (), filterAction :: Value Text
filterAction = Value Text
filterAction,
filterCriteria :: FilterCriteriaProperty
filterCriteria = FilterCriteriaProperty
filterCriteria, name :: Value Text
name = Value Text
name,
description :: Maybe (Value Text)
description = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, tags :: Maybe (Map Text (Value Text))
tags = Maybe (Map Text (Value Text))
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Filter where
toResourceProperties :: Filter -> ResourceProperties
toResourceProperties Filter {Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: Filter -> ()
description :: Filter -> Maybe (Value Text)
filterAction :: Filter -> Value Text
filterCriteria :: Filter -> FilterCriteriaProperty
name :: Filter -> Value Text
tags :: Filter -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::InspectorV2::Filter", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"FilterAction" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
filterAction,
Key
"FilterCriteria" Key -> FilterCriteriaProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= FilterCriteriaProperty
filterCriteria, Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Description" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
description,
Key -> Map Text (Value Text) -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" (Map Text (Value Text) -> (Key, Value))
-> Maybe (Map Text (Value Text)) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text (Value Text))
tags]))}
instance JSON.ToJSON Filter where
toJSON :: Filter -> Value
toJSON Filter {Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: Filter -> ()
description :: Filter -> Maybe (Value Text)
filterAction :: Filter -> Value Text
filterCriteria :: Filter -> FilterCriteriaProperty
name :: Filter -> Value Text
tags :: Filter -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"FilterAction" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
filterAction,
Key
"FilterCriteria" Key -> FilterCriteriaProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= FilterCriteriaProperty
filterCriteria, Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Description" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
description,
Key -> Map Text (Value Text) -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" (Map Text (Value Text) -> (Key, Value))
-> Maybe (Map Text (Value Text)) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text (Value Text))
tags])))
instance Property "Description" Filter where
type PropertyType "Description" Filter = Value Prelude.Text
set :: PropertyType "Description" Filter -> Filter -> Filter
set PropertyType "Description" Filter
newValue Filter {Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: Filter -> ()
description :: Filter -> Maybe (Value Text)
filterAction :: Filter -> Value Text
filterCriteria :: Filter -> FilterCriteriaProperty
name :: Filter -> Value Text
tags :: Filter -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
= Filter {description :: Maybe (Value Text)
description = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Description" Filter
Value Text
newValue, Maybe (Map Text (Value Text))
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: ()
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
instance Property "FilterAction" Filter where
type PropertyType "FilterAction" Filter = Value Prelude.Text
set :: PropertyType "FilterAction" Filter -> Filter -> Filter
set PropertyType "FilterAction" Filter
newValue Filter {Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: Filter -> ()
description :: Filter -> Maybe (Value Text)
filterAction :: Filter -> Value Text
filterCriteria :: Filter -> FilterCriteriaProperty
name :: Filter -> Value Text
tags :: Filter -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..} = Filter {filterAction :: Value Text
filterAction = PropertyType "FilterAction" Filter
Value Text
newValue, Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
instance Property "FilterCriteria" Filter where
type PropertyType "FilterCriteria" Filter = FilterCriteriaProperty
set :: PropertyType "FilterCriteria" Filter -> Filter -> Filter
set PropertyType "FilterCriteria" Filter
newValue Filter {Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: Filter -> ()
description :: Filter -> Maybe (Value Text)
filterAction :: Filter -> Value Text
filterCriteria :: Filter -> FilterCriteriaProperty
name :: Filter -> Value Text
tags :: Filter -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..} = Filter {filterCriteria :: FilterCriteriaProperty
filterCriteria = PropertyType "FilterCriteria" Filter
FilterCriteriaProperty
newValue, Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
name :: Value Text
tags :: Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
instance Property "Name" Filter where
type PropertyType "Name" Filter = Value Prelude.Text
set :: PropertyType "Name" Filter -> Filter -> Filter
set PropertyType "Name" Filter
newValue Filter {Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: Filter -> ()
description :: Filter -> Maybe (Value Text)
filterAction :: Filter -> Value Text
filterCriteria :: Filter -> FilterCriteriaProperty
name :: Filter -> Value Text
tags :: Filter -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..} = Filter {name :: Value Text
name = PropertyType "Name" Filter
Value Text
newValue, Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
tags :: Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
tags :: Maybe (Map Text (Value Text))
..}
instance Property "Tags" Filter where
type PropertyType "Tags" Filter = Prelude.Map Prelude.Text (Value Prelude.Text)
set :: PropertyType "Tags" Filter -> Filter -> Filter
set PropertyType "Tags" Filter
newValue Filter {Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: Filter -> ()
description :: Filter -> Maybe (Value Text)
filterAction :: Filter -> Value Text
filterCriteria :: Filter -> FilterCriteriaProperty
name :: Filter -> Value Text
tags :: Filter -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
= Filter {tags :: Maybe (Map Text (Value Text))
tags = Map Text (Value Text) -> Maybe (Map Text (Value Text))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure Map Text (Value Text)
PropertyType "Tags" Filter
newValue, Maybe (Value Text)
()
Value Text
FilterCriteriaProperty
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
filterAction :: Value Text
filterCriteria :: FilterCriteriaProperty
name :: Value Text
..}