module Stratosphere.VpcLattice.Rule (
module Exports, Rule(..), mkRule
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.VpcLattice.Rule.ActionProperty as Exports
import {-# SOURCE #-} Stratosphere.VpcLattice.Rule.MatchProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Rule
=
Rule {Rule -> ()
haddock_workaround_ :: (),
Rule -> ActionProperty
action :: ActionProperty,
Rule -> Maybe (Value Text)
listenerIdentifier :: (Prelude.Maybe (Value Prelude.Text)),
Rule -> MatchProperty
match :: MatchProperty,
Rule -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text)),
Rule -> Value Integer
priority :: (Value Prelude.Integer),
Rule -> Maybe (Value Text)
serviceIdentifier :: (Prelude.Maybe (Value Prelude.Text)),
Rule -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
deriving stock (Rule -> Rule -> Bool
(Rule -> Rule -> Bool) -> (Rule -> Rule -> Bool) -> Eq Rule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Rule -> Rule -> Bool
== :: Rule -> Rule -> Bool
$c/= :: Rule -> Rule -> Bool
/= :: Rule -> Rule -> Bool
Prelude.Eq, Int -> Rule -> ShowS
[Rule] -> ShowS
Rule -> String
(Int -> Rule -> ShowS)
-> (Rule -> String) -> ([Rule] -> ShowS) -> Show Rule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Rule -> ShowS
showsPrec :: Int -> Rule -> ShowS
$cshow :: Rule -> String
show :: Rule -> String
$cshowList :: [Rule] -> ShowS
showList :: [Rule] -> ShowS
Prelude.Show)
mkRule ::
ActionProperty -> MatchProperty -> Value Prelude.Integer -> Rule
mkRule :: ActionProperty -> MatchProperty -> Value Integer -> Rule
mkRule ActionProperty
action MatchProperty
match Value Integer
priority
= Rule
{haddock_workaround_ :: ()
haddock_workaround_ = (), action :: ActionProperty
action = ActionProperty
action, match :: MatchProperty
match = MatchProperty
match,
priority :: Value Integer
priority = Value Integer
priority, listenerIdentifier :: Maybe (Value Text)
listenerIdentifier = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
name :: Maybe (Value Text)
name = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, serviceIdentifier :: Maybe (Value Text)
serviceIdentifier = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Rule where
toResourceProperties :: Rule -> ResourceProperties
toResourceProperties Rule {Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: Rule -> ()
action :: Rule -> ActionProperty
listenerIdentifier :: Rule -> Maybe (Value Text)
match :: Rule -> MatchProperty
name :: Rule -> Maybe (Value Text)
priority :: Rule -> Value Integer
serviceIdentifier :: Rule -> Maybe (Value Text)
tags :: Rule -> Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::VpcLattice::Rule", 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
"Action" Key -> ActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionProperty
action, Key
"Match" Key -> MatchProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= MatchProperty
match,
Key
"Priority" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
priority]
([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
"ListenerIdentifier" (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)
listenerIdentifier,
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,
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
"ServiceIdentifier" (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)
serviceIdentifier,
Key -> [Tag] -> (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" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON Rule where
toJSON :: Rule -> Value
toJSON Rule {Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: Rule -> ()
action :: Rule -> ActionProperty
listenerIdentifier :: Rule -> Maybe (Value Text)
match :: Rule -> MatchProperty
name :: Rule -> Maybe (Value Text)
priority :: Rule -> Value Integer
serviceIdentifier :: Rule -> Maybe (Value Text)
tags :: Rule -> Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= [(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
"Action" Key -> ActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionProperty
action, Key
"Match" Key -> MatchProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= MatchProperty
match,
Key
"Priority" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
priority]
([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
"ListenerIdentifier" (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)
listenerIdentifier,
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,
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
"ServiceIdentifier" (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)
serviceIdentifier,
Key -> [Tag] -> (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" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "Action" Rule where
type PropertyType "Action" Rule = ActionProperty
set :: PropertyType "Action" Rule -> Rule -> Rule
set PropertyType "Action" Rule
newValue Rule {Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: Rule -> ()
action :: Rule -> ActionProperty
listenerIdentifier :: Rule -> Maybe (Value Text)
match :: Rule -> MatchProperty
name :: Rule -> Maybe (Value Text)
priority :: Rule -> Value Integer
serviceIdentifier :: Rule -> Maybe (Value Text)
tags :: Rule -> Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Rule {action :: ActionProperty
action = PropertyType "Action" Rule
ActionProperty
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
haddock_workaround_ :: ()
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "ListenerIdentifier" Rule where
type PropertyType "ListenerIdentifier" Rule = Value Prelude.Text
set :: PropertyType "ListenerIdentifier" Rule -> Rule -> Rule
set PropertyType "ListenerIdentifier" Rule
newValue Rule {Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: Rule -> ()
action :: Rule -> ActionProperty
listenerIdentifier :: Rule -> Maybe (Value Text)
match :: Rule -> MatchProperty
name :: Rule -> Maybe (Value Text)
priority :: Rule -> Value Integer
serviceIdentifier :: Rule -> Maybe (Value Text)
tags :: Rule -> Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= Rule {listenerIdentifier :: Maybe (Value Text)
listenerIdentifier = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ListenerIdentifier" Rule
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Match" Rule where
type PropertyType "Match" Rule = MatchProperty
set :: PropertyType "Match" Rule -> Rule -> Rule
set PropertyType "Match" Rule
newValue Rule {Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: Rule -> ()
action :: Rule -> ActionProperty
listenerIdentifier :: Rule -> Maybe (Value Text)
match :: Rule -> MatchProperty
name :: Rule -> Maybe (Value Text)
priority :: Rule -> Value Integer
serviceIdentifier :: Rule -> Maybe (Value Text)
tags :: Rule -> Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Rule {match :: MatchProperty
match = PropertyType "Match" Rule
MatchProperty
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Integer
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Name" Rule where
type PropertyType "Name" Rule = Value Prelude.Text
set :: PropertyType "Name" Rule -> Rule -> Rule
set PropertyType "Name" Rule
newValue Rule {Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: Rule -> ()
action :: Rule -> ActionProperty
listenerIdentifier :: Rule -> Maybe (Value Text)
match :: Rule -> MatchProperty
name :: Rule -> Maybe (Value Text)
priority :: Rule -> Value Integer
serviceIdentifier :: Rule -> Maybe (Value Text)
tags :: Rule -> Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Rule {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" Rule
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Priority" Rule where
type PropertyType "Priority" Rule = Value Prelude.Integer
set :: PropertyType "Priority" Rule -> Rule -> Rule
set PropertyType "Priority" Rule
newValue Rule {Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: Rule -> ()
action :: Rule -> ActionProperty
listenerIdentifier :: Rule -> Maybe (Value Text)
match :: Rule -> MatchProperty
name :: Rule -> Maybe (Value Text)
priority :: Rule -> Value Integer
serviceIdentifier :: Rule -> Maybe (Value Text)
tags :: Rule -> Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Rule {priority :: Value Integer
priority = PropertyType "Priority" Rule
Value Integer
newValue, Maybe [Tag]
Maybe (Value Text)
()
MatchProperty
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "ServiceIdentifier" Rule where
type PropertyType "ServiceIdentifier" Rule = Value Prelude.Text
set :: PropertyType "ServiceIdentifier" Rule -> Rule -> Rule
set PropertyType "ServiceIdentifier" Rule
newValue Rule {Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: Rule -> ()
action :: Rule -> ActionProperty
listenerIdentifier :: Rule -> Maybe (Value Text)
match :: Rule -> MatchProperty
name :: Rule -> Maybe (Value Text)
priority :: Rule -> Value Integer
serviceIdentifier :: Rule -> Maybe (Value Text)
tags :: Rule -> Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= Rule {serviceIdentifier :: Maybe (Value Text)
serviceIdentifier = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ServiceIdentifier" Rule
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
tags :: Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
tags :: Maybe [Tag]
..}
instance Property "Tags" Rule where
type PropertyType "Tags" Rule = [Tag]
set :: PropertyType "Tags" Rule -> Rule -> Rule
set PropertyType "Tags" Rule
newValue Rule {Maybe [Tag]
Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: Rule -> ()
action :: Rule -> ActionProperty
listenerIdentifier :: Rule -> Maybe (Value Text)
match :: Rule -> MatchProperty
name :: Rule -> Maybe (Value Text)
priority :: Rule -> Value Integer
serviceIdentifier :: Rule -> Maybe (Value Text)
tags :: Rule -> Maybe [Tag]
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Rule {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Rule
newValue, Maybe (Value Text)
()
Value Integer
MatchProperty
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
haddock_workaround_ :: ()
action :: ActionProperty
listenerIdentifier :: Maybe (Value Text)
match :: MatchProperty
name :: Maybe (Value Text)
priority :: Value Integer
serviceIdentifier :: Maybe (Value Text)
..}