module Stratosphere.ApiGatewayV2.RoutingRule.ConditionProperty (
module Exports, ConditionProperty(..), mkConditionProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.ApiGatewayV2.RoutingRule.MatchBasePathsProperty as Exports
import {-# SOURCE #-} Stratosphere.ApiGatewayV2.RoutingRule.MatchHeadersProperty as Exports
import Stratosphere.ResourceProperties
data ConditionProperty
=
ConditionProperty {ConditionProperty -> ()
haddock_workaround_ :: (),
ConditionProperty -> Maybe MatchBasePathsProperty
matchBasePaths :: (Prelude.Maybe MatchBasePathsProperty),
:: (Prelude.Maybe MatchHeadersProperty)}
deriving stock (ConditionProperty -> ConditionProperty -> Bool
(ConditionProperty -> ConditionProperty -> Bool)
-> (ConditionProperty -> ConditionProperty -> Bool)
-> Eq ConditionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConditionProperty -> ConditionProperty -> Bool
== :: ConditionProperty -> ConditionProperty -> Bool
$c/= :: ConditionProperty -> ConditionProperty -> Bool
/= :: ConditionProperty -> ConditionProperty -> Bool
Prelude.Eq, Int -> ConditionProperty -> ShowS
[ConditionProperty] -> ShowS
ConditionProperty -> String
(Int -> ConditionProperty -> ShowS)
-> (ConditionProperty -> String)
-> ([ConditionProperty] -> ShowS)
-> Show ConditionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConditionProperty -> ShowS
showsPrec :: Int -> ConditionProperty -> ShowS
$cshow :: ConditionProperty -> String
show :: ConditionProperty -> String
$cshowList :: [ConditionProperty] -> ShowS
showList :: [ConditionProperty] -> ShowS
Prelude.Show)
mkConditionProperty :: ConditionProperty
mkConditionProperty :: ConditionProperty
mkConditionProperty
= ConditionProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), matchBasePaths :: Maybe MatchBasePathsProperty
matchBasePaths = Maybe MatchBasePathsProperty
forall a. Maybe a
Prelude.Nothing,
matchHeaders :: Maybe MatchHeadersProperty
matchHeaders = Maybe MatchHeadersProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ConditionProperty where
toResourceProperties :: ConditionProperty -> ResourceProperties
toResourceProperties ConditionProperty {Maybe MatchBasePathsProperty
Maybe MatchHeadersProperty
()
haddock_workaround_ :: ConditionProperty -> ()
matchBasePaths :: ConditionProperty -> Maybe MatchBasePathsProperty
matchHeaders :: ConditionProperty -> Maybe MatchHeadersProperty
haddock_workaround_ :: ()
matchBasePaths :: Maybe MatchBasePathsProperty
matchHeaders :: Maybe MatchHeadersProperty
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::ApiGatewayV2::RoutingRule.Condition",
supportsTags :: Bool
supportsTags = Bool
Prelude.False,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> MatchBasePathsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MatchBasePaths" (MatchBasePathsProperty -> (Key, Value))
-> Maybe MatchBasePathsProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MatchBasePathsProperty
matchBasePaths,
Key -> MatchHeadersProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MatchHeaders" (MatchHeadersProperty -> (Key, Value))
-> Maybe MatchHeadersProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MatchHeadersProperty
matchHeaders])}
instance JSON.ToJSON ConditionProperty where
toJSON :: ConditionProperty -> Value
toJSON ConditionProperty {Maybe MatchBasePathsProperty
Maybe MatchHeadersProperty
()
haddock_workaround_ :: ConditionProperty -> ()
matchBasePaths :: ConditionProperty -> Maybe MatchBasePathsProperty
matchHeaders :: ConditionProperty -> Maybe MatchHeadersProperty
haddock_workaround_ :: ()
matchBasePaths :: Maybe MatchBasePathsProperty
matchHeaders :: Maybe MatchHeadersProperty
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> MatchBasePathsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MatchBasePaths" (MatchBasePathsProperty -> (Key, Value))
-> Maybe MatchBasePathsProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MatchBasePathsProperty
matchBasePaths,
Key -> MatchHeadersProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MatchHeaders" (MatchHeadersProperty -> (Key, Value))
-> Maybe MatchHeadersProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MatchHeadersProperty
matchHeaders]))
instance Property "MatchBasePaths" ConditionProperty where
type PropertyType "MatchBasePaths" ConditionProperty = MatchBasePathsProperty
set :: PropertyType "MatchBasePaths" ConditionProperty
-> ConditionProperty -> ConditionProperty
set PropertyType "MatchBasePaths" ConditionProperty
newValue ConditionProperty {Maybe MatchBasePathsProperty
Maybe MatchHeadersProperty
()
haddock_workaround_ :: ConditionProperty -> ()
matchBasePaths :: ConditionProperty -> Maybe MatchBasePathsProperty
matchHeaders :: ConditionProperty -> Maybe MatchHeadersProperty
haddock_workaround_ :: ()
matchBasePaths :: Maybe MatchBasePathsProperty
matchHeaders :: Maybe MatchHeadersProperty
..}
= ConditionProperty {matchBasePaths :: Maybe MatchBasePathsProperty
matchBasePaths = MatchBasePathsProperty -> Maybe MatchBasePathsProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "MatchBasePaths" ConditionProperty
MatchBasePathsProperty
newValue, Maybe MatchHeadersProperty
()
haddock_workaround_ :: ()
matchHeaders :: Maybe MatchHeadersProperty
haddock_workaround_ :: ()
matchHeaders :: Maybe MatchHeadersProperty
..}
instance Property "MatchHeaders" ConditionProperty where
type PropertyType "MatchHeaders" ConditionProperty = MatchHeadersProperty
set :: PropertyType "MatchHeaders" ConditionProperty
-> ConditionProperty -> ConditionProperty
set PropertyType "MatchHeaders" ConditionProperty
newValue ConditionProperty {Maybe MatchBasePathsProperty
Maybe MatchHeadersProperty
()
haddock_workaround_ :: ConditionProperty -> ()
matchBasePaths :: ConditionProperty -> Maybe MatchBasePathsProperty
matchHeaders :: ConditionProperty -> Maybe MatchHeadersProperty
haddock_workaround_ :: ()
matchBasePaths :: Maybe MatchBasePathsProperty
matchHeaders :: Maybe MatchHeadersProperty
..}
= ConditionProperty {matchHeaders :: Maybe MatchHeadersProperty
matchHeaders = MatchHeadersProperty -> Maybe MatchHeadersProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "MatchHeaders" ConditionProperty
MatchHeadersProperty
newValue, Maybe MatchBasePathsProperty
()
haddock_workaround_ :: ()
matchBasePaths :: Maybe MatchBasePathsProperty
haddock_workaround_ :: ()
matchBasePaths :: Maybe MatchBasePathsProperty
..}