module Stratosphere.SES.ReceiptFilter.FilterProperty (
module Exports, FilterProperty(..), mkFilterProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SES.ReceiptFilter.IpFilterProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data FilterProperty
=
FilterProperty {FilterProperty -> ()
haddock_workaround_ :: (),
FilterProperty -> IpFilterProperty
ipFilter :: IpFilterProperty,
FilterProperty -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text))}
deriving stock (FilterProperty -> FilterProperty -> Bool
(FilterProperty -> FilterProperty -> Bool)
-> (FilterProperty -> FilterProperty -> Bool) -> Eq FilterProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FilterProperty -> FilterProperty -> Bool
== :: FilterProperty -> FilterProperty -> Bool
$c/= :: FilterProperty -> FilterProperty -> Bool
/= :: FilterProperty -> FilterProperty -> Bool
Prelude.Eq, Int -> FilterProperty -> ShowS
[FilterProperty] -> ShowS
FilterProperty -> String
(Int -> FilterProperty -> ShowS)
-> (FilterProperty -> String)
-> ([FilterProperty] -> ShowS)
-> Show FilterProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FilterProperty -> ShowS
showsPrec :: Int -> FilterProperty -> ShowS
$cshow :: FilterProperty -> String
show :: FilterProperty -> String
$cshowList :: [FilterProperty] -> ShowS
showList :: [FilterProperty] -> ShowS
Prelude.Show)
mkFilterProperty :: IpFilterProperty -> FilterProperty
mkFilterProperty :: IpFilterProperty -> FilterProperty
mkFilterProperty IpFilterProperty
ipFilter
= FilterProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), ipFilter :: IpFilterProperty
ipFilter = IpFilterProperty
ipFilter,
name :: Maybe (Value Text)
name = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties FilterProperty where
toResourceProperties :: FilterProperty -> ResourceProperties
toResourceProperties FilterProperty {Maybe (Value Text)
()
IpFilterProperty
haddock_workaround_ :: FilterProperty -> ()
ipFilter :: FilterProperty -> IpFilterProperty
name :: FilterProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
ipFilter :: IpFilterProperty
name :: Maybe (Value Text)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::SES::ReceiptFilter.Filter",
supportsTags :: Bool
supportsTags = Bool
Prelude.False,
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
"IpFilter" Key -> IpFilterProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= IpFilterProperty
ipFilter]
([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
"Name" (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)
name]))}
instance JSON.ToJSON FilterProperty where
toJSON :: FilterProperty -> Value
toJSON FilterProperty {Maybe (Value Text)
()
IpFilterProperty
haddock_workaround_ :: FilterProperty -> ()
ipFilter :: FilterProperty -> IpFilterProperty
name :: FilterProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
ipFilter :: IpFilterProperty
name :: Maybe (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
"IpFilter" Key -> IpFilterProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= IpFilterProperty
ipFilter]
([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
"Name" (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)
name])))
instance Property "IpFilter" FilterProperty where
type PropertyType "IpFilter" FilterProperty = IpFilterProperty
set :: PropertyType "IpFilter" FilterProperty
-> FilterProperty -> FilterProperty
set PropertyType "IpFilter" FilterProperty
newValue FilterProperty {Maybe (Value Text)
()
IpFilterProperty
haddock_workaround_ :: FilterProperty -> ()
ipFilter :: FilterProperty -> IpFilterProperty
name :: FilterProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
ipFilter :: IpFilterProperty
name :: Maybe (Value Text)
..}
= FilterProperty {ipFilter :: IpFilterProperty
ipFilter = PropertyType "IpFilter" FilterProperty
IpFilterProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
name :: Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
..}
instance Property "Name" FilterProperty where
type PropertyType "Name" FilterProperty = Value Prelude.Text
set :: PropertyType "Name" FilterProperty
-> FilterProperty -> FilterProperty
set PropertyType "Name" FilterProperty
newValue FilterProperty {Maybe (Value Text)
()
IpFilterProperty
haddock_workaround_ :: FilterProperty -> ()
ipFilter :: FilterProperty -> IpFilterProperty
name :: FilterProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
ipFilter :: IpFilterProperty
name :: Maybe (Value Text)
..}
= FilterProperty {name :: Maybe (Value Text)
name = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Name" FilterProperty
Value Text
newValue, ()
IpFilterProperty
haddock_workaround_ :: ()
ipFilter :: IpFilterProperty
haddock_workaround_ :: ()
ipFilter :: IpFilterProperty
..}