module Stratosphere.S3.Bucket.RoutingRuleProperty (
module Exports, RoutingRuleProperty(..), mkRoutingRuleProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.S3.Bucket.RedirectRuleProperty as Exports
import {-# SOURCE #-} Stratosphere.S3.Bucket.RoutingRuleConditionProperty as Exports
import Stratosphere.ResourceProperties
data RoutingRuleProperty
=
RoutingRuleProperty {RoutingRuleProperty -> ()
haddock_workaround_ :: (),
RoutingRuleProperty -> RedirectRuleProperty
redirectRule :: RedirectRuleProperty,
RoutingRuleProperty -> Maybe RoutingRuleConditionProperty
routingRuleCondition :: (Prelude.Maybe RoutingRuleConditionProperty)}
deriving stock (RoutingRuleProperty -> RoutingRuleProperty -> Bool
(RoutingRuleProperty -> RoutingRuleProperty -> Bool)
-> (RoutingRuleProperty -> RoutingRuleProperty -> Bool)
-> Eq RoutingRuleProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RoutingRuleProperty -> RoutingRuleProperty -> Bool
== :: RoutingRuleProperty -> RoutingRuleProperty -> Bool
$c/= :: RoutingRuleProperty -> RoutingRuleProperty -> Bool
/= :: RoutingRuleProperty -> RoutingRuleProperty -> Bool
Prelude.Eq, Int -> RoutingRuleProperty -> ShowS
[RoutingRuleProperty] -> ShowS
RoutingRuleProperty -> String
(Int -> RoutingRuleProperty -> ShowS)
-> (RoutingRuleProperty -> String)
-> ([RoutingRuleProperty] -> ShowS)
-> Show RoutingRuleProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RoutingRuleProperty -> ShowS
showsPrec :: Int -> RoutingRuleProperty -> ShowS
$cshow :: RoutingRuleProperty -> String
show :: RoutingRuleProperty -> String
$cshowList :: [RoutingRuleProperty] -> ShowS
showList :: [RoutingRuleProperty] -> ShowS
Prelude.Show)
mkRoutingRuleProperty ::
RedirectRuleProperty -> RoutingRuleProperty
mkRoutingRuleProperty :: RedirectRuleProperty -> RoutingRuleProperty
mkRoutingRuleProperty RedirectRuleProperty
redirectRule
= RoutingRuleProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), redirectRule :: RedirectRuleProperty
redirectRule = RedirectRuleProperty
redirectRule,
routingRuleCondition :: Maybe RoutingRuleConditionProperty
routingRuleCondition = Maybe RoutingRuleConditionProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties RoutingRuleProperty where
toResourceProperties :: RoutingRuleProperty -> ResourceProperties
toResourceProperties RoutingRuleProperty {Maybe RoutingRuleConditionProperty
()
RedirectRuleProperty
haddock_workaround_ :: RoutingRuleProperty -> ()
redirectRule :: RoutingRuleProperty -> RedirectRuleProperty
routingRuleCondition :: RoutingRuleProperty -> Maybe RoutingRuleConditionProperty
haddock_workaround_ :: ()
redirectRule :: RedirectRuleProperty
routingRuleCondition :: Maybe RoutingRuleConditionProperty
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::S3::Bucket.RoutingRule",
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
"RedirectRule" Key -> RedirectRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= RedirectRuleProperty
redirectRule]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> RoutingRuleConditionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RoutingRuleCondition"
(RoutingRuleConditionProperty -> (Key, Value))
-> Maybe RoutingRuleConditionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RoutingRuleConditionProperty
routingRuleCondition]))}
instance JSON.ToJSON RoutingRuleProperty where
toJSON :: RoutingRuleProperty -> Value
toJSON RoutingRuleProperty {Maybe RoutingRuleConditionProperty
()
RedirectRuleProperty
haddock_workaround_ :: RoutingRuleProperty -> ()
redirectRule :: RoutingRuleProperty -> RedirectRuleProperty
routingRuleCondition :: RoutingRuleProperty -> Maybe RoutingRuleConditionProperty
haddock_workaround_ :: ()
redirectRule :: RedirectRuleProperty
routingRuleCondition :: Maybe RoutingRuleConditionProperty
..}
= [(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
"RedirectRule" Key -> RedirectRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= RedirectRuleProperty
redirectRule]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> RoutingRuleConditionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RoutingRuleCondition"
(RoutingRuleConditionProperty -> (Key, Value))
-> Maybe RoutingRuleConditionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RoutingRuleConditionProperty
routingRuleCondition])))
instance Property "RedirectRule" RoutingRuleProperty where
type PropertyType "RedirectRule" RoutingRuleProperty = RedirectRuleProperty
set :: PropertyType "RedirectRule" RoutingRuleProperty
-> RoutingRuleProperty -> RoutingRuleProperty
set PropertyType "RedirectRule" RoutingRuleProperty
newValue RoutingRuleProperty {Maybe RoutingRuleConditionProperty
()
RedirectRuleProperty
haddock_workaround_ :: RoutingRuleProperty -> ()
redirectRule :: RoutingRuleProperty -> RedirectRuleProperty
routingRuleCondition :: RoutingRuleProperty -> Maybe RoutingRuleConditionProperty
haddock_workaround_ :: ()
redirectRule :: RedirectRuleProperty
routingRuleCondition :: Maybe RoutingRuleConditionProperty
..}
= RoutingRuleProperty {redirectRule :: RedirectRuleProperty
redirectRule = PropertyType "RedirectRule" RoutingRuleProperty
RedirectRuleProperty
newValue, Maybe RoutingRuleConditionProperty
()
haddock_workaround_ :: ()
routingRuleCondition :: Maybe RoutingRuleConditionProperty
haddock_workaround_ :: ()
routingRuleCondition :: Maybe RoutingRuleConditionProperty
..}
instance Property "RoutingRuleCondition" RoutingRuleProperty where
type PropertyType "RoutingRuleCondition" RoutingRuleProperty = RoutingRuleConditionProperty
set :: PropertyType "RoutingRuleCondition" RoutingRuleProperty
-> RoutingRuleProperty -> RoutingRuleProperty
set PropertyType "RoutingRuleCondition" RoutingRuleProperty
newValue RoutingRuleProperty {Maybe RoutingRuleConditionProperty
()
RedirectRuleProperty
haddock_workaround_ :: RoutingRuleProperty -> ()
redirectRule :: RoutingRuleProperty -> RedirectRuleProperty
routingRuleCondition :: RoutingRuleProperty -> Maybe RoutingRuleConditionProperty
haddock_workaround_ :: ()
redirectRule :: RedirectRuleProperty
routingRuleCondition :: Maybe RoutingRuleConditionProperty
..}
= RoutingRuleProperty
{routingRuleCondition :: Maybe RoutingRuleConditionProperty
routingRuleCondition = RoutingRuleConditionProperty -> Maybe RoutingRuleConditionProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "RoutingRuleCondition" RoutingRuleProperty
RoutingRuleConditionProperty
newValue, ()
RedirectRuleProperty
haddock_workaround_ :: ()
redirectRule :: RedirectRuleProperty
haddock_workaround_ :: ()
redirectRule :: RedirectRuleProperty
..}