module Stratosphere.AppMesh.GatewayRoute.HttpGatewayRouteActionProperty (
        module Exports, HttpGatewayRouteActionProperty(..),
        mkHttpGatewayRouteActionProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.AppMesh.GatewayRoute.GatewayRouteTargetProperty as Exports
import {-# SOURCE #-} Stratosphere.AppMesh.GatewayRoute.HttpGatewayRouteRewriteProperty as Exports
import Stratosphere.ResourceProperties
data HttpGatewayRouteActionProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-gatewayroute-httpgatewayrouteaction.html>
    HttpGatewayRouteActionProperty {HttpGatewayRouteActionProperty -> ()
haddock_workaround_ :: (),
                                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-gatewayroute-httpgatewayrouteaction.html#cfn-appmesh-gatewayroute-httpgatewayrouteaction-rewrite>
                                    HttpGatewayRouteActionProperty
-> Maybe HttpGatewayRouteRewriteProperty
rewrite :: (Prelude.Maybe HttpGatewayRouteRewriteProperty),
                                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-gatewayroute-httpgatewayrouteaction.html#cfn-appmesh-gatewayroute-httpgatewayrouteaction-target>
                                    HttpGatewayRouteActionProperty -> GatewayRouteTargetProperty
target :: GatewayRouteTargetProperty}
  deriving stock (HttpGatewayRouteActionProperty
-> HttpGatewayRouteActionProperty -> Bool
(HttpGatewayRouteActionProperty
 -> HttpGatewayRouteActionProperty -> Bool)
-> (HttpGatewayRouteActionProperty
    -> HttpGatewayRouteActionProperty -> Bool)
-> Eq HttpGatewayRouteActionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HttpGatewayRouteActionProperty
-> HttpGatewayRouteActionProperty -> Bool
== :: HttpGatewayRouteActionProperty
-> HttpGatewayRouteActionProperty -> Bool
$c/= :: HttpGatewayRouteActionProperty
-> HttpGatewayRouteActionProperty -> Bool
/= :: HttpGatewayRouteActionProperty
-> HttpGatewayRouteActionProperty -> Bool
Prelude.Eq, Int -> HttpGatewayRouteActionProperty -> ShowS
[HttpGatewayRouteActionProperty] -> ShowS
HttpGatewayRouteActionProperty -> String
(Int -> HttpGatewayRouteActionProperty -> ShowS)
-> (HttpGatewayRouteActionProperty -> String)
-> ([HttpGatewayRouteActionProperty] -> ShowS)
-> Show HttpGatewayRouteActionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HttpGatewayRouteActionProperty -> ShowS
showsPrec :: Int -> HttpGatewayRouteActionProperty -> ShowS
$cshow :: HttpGatewayRouteActionProperty -> String
show :: HttpGatewayRouteActionProperty -> String
$cshowList :: [HttpGatewayRouteActionProperty] -> ShowS
showList :: [HttpGatewayRouteActionProperty] -> ShowS
Prelude.Show)
mkHttpGatewayRouteActionProperty ::
  GatewayRouteTargetProperty -> HttpGatewayRouteActionProperty
mkHttpGatewayRouteActionProperty :: GatewayRouteTargetProperty -> HttpGatewayRouteActionProperty
mkHttpGatewayRouteActionProperty GatewayRouteTargetProperty
target
  = HttpGatewayRouteActionProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), target :: GatewayRouteTargetProperty
target = GatewayRouteTargetProperty
target,
       rewrite :: Maybe HttpGatewayRouteRewriteProperty
rewrite = Maybe HttpGatewayRouteRewriteProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties HttpGatewayRouteActionProperty where
  toResourceProperties :: HttpGatewayRouteActionProperty -> ResourceProperties
toResourceProperties HttpGatewayRouteActionProperty {Maybe HttpGatewayRouteRewriteProperty
()
GatewayRouteTargetProperty
haddock_workaround_ :: HttpGatewayRouteActionProperty -> ()
rewrite :: HttpGatewayRouteActionProperty
-> Maybe HttpGatewayRouteRewriteProperty
target :: HttpGatewayRouteActionProperty -> GatewayRouteTargetProperty
haddock_workaround_ :: ()
rewrite :: Maybe HttpGatewayRouteRewriteProperty
target :: GatewayRouteTargetProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::AppMesh::GatewayRoute.HttpGatewayRouteAction",
         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
"Target" Key -> GatewayRouteTargetProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= GatewayRouteTargetProperty
target]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> HttpGatewayRouteRewriteProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Rewrite" (HttpGatewayRouteRewriteProperty -> (Key, Value))
-> Maybe HttpGatewayRouteRewriteProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HttpGatewayRouteRewriteProperty
rewrite]))}
instance JSON.ToJSON HttpGatewayRouteActionProperty where
  toJSON :: HttpGatewayRouteActionProperty -> Value
toJSON HttpGatewayRouteActionProperty {Maybe HttpGatewayRouteRewriteProperty
()
GatewayRouteTargetProperty
haddock_workaround_ :: HttpGatewayRouteActionProperty -> ()
rewrite :: HttpGatewayRouteActionProperty
-> Maybe HttpGatewayRouteRewriteProperty
target :: HttpGatewayRouteActionProperty -> GatewayRouteTargetProperty
haddock_workaround_ :: ()
rewrite :: Maybe HttpGatewayRouteRewriteProperty
target :: GatewayRouteTargetProperty
..}
    = [(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
"Target" Key -> GatewayRouteTargetProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= GatewayRouteTargetProperty
target]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> HttpGatewayRouteRewriteProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Rewrite" (HttpGatewayRouteRewriteProperty -> (Key, Value))
-> Maybe HttpGatewayRouteRewriteProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HttpGatewayRouteRewriteProperty
rewrite])))
instance Property "Rewrite" HttpGatewayRouteActionProperty where
  type PropertyType "Rewrite" HttpGatewayRouteActionProperty = HttpGatewayRouteRewriteProperty
  set :: PropertyType "Rewrite" HttpGatewayRouteActionProperty
-> HttpGatewayRouteActionProperty -> HttpGatewayRouteActionProperty
set PropertyType "Rewrite" HttpGatewayRouteActionProperty
newValue HttpGatewayRouteActionProperty {Maybe HttpGatewayRouteRewriteProperty
()
GatewayRouteTargetProperty
haddock_workaround_ :: HttpGatewayRouteActionProperty -> ()
rewrite :: HttpGatewayRouteActionProperty
-> Maybe HttpGatewayRouteRewriteProperty
target :: HttpGatewayRouteActionProperty -> GatewayRouteTargetProperty
haddock_workaround_ :: ()
rewrite :: Maybe HttpGatewayRouteRewriteProperty
target :: GatewayRouteTargetProperty
..}
    = HttpGatewayRouteActionProperty
        {rewrite :: Maybe HttpGatewayRouteRewriteProperty
rewrite = HttpGatewayRouteRewriteProperty
-> Maybe HttpGatewayRouteRewriteProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Rewrite" HttpGatewayRouteActionProperty
HttpGatewayRouteRewriteProperty
newValue, ()
GatewayRouteTargetProperty
haddock_workaround_ :: ()
target :: GatewayRouteTargetProperty
haddock_workaround_ :: ()
target :: GatewayRouteTargetProperty
..}
instance Property "Target" HttpGatewayRouteActionProperty where
  type PropertyType "Target" HttpGatewayRouteActionProperty = GatewayRouteTargetProperty
  set :: PropertyType "Target" HttpGatewayRouteActionProperty
-> HttpGatewayRouteActionProperty -> HttpGatewayRouteActionProperty
set PropertyType "Target" HttpGatewayRouteActionProperty
newValue HttpGatewayRouteActionProperty {Maybe HttpGatewayRouteRewriteProperty
()
GatewayRouteTargetProperty
haddock_workaround_ :: HttpGatewayRouteActionProperty -> ()
rewrite :: HttpGatewayRouteActionProperty
-> Maybe HttpGatewayRouteRewriteProperty
target :: HttpGatewayRouteActionProperty -> GatewayRouteTargetProperty
haddock_workaround_ :: ()
rewrite :: Maybe HttpGatewayRouteRewriteProperty
target :: GatewayRouteTargetProperty
..}
    = HttpGatewayRouteActionProperty {target :: GatewayRouteTargetProperty
target = PropertyType "Target" HttpGatewayRouteActionProperty
GatewayRouteTargetProperty
newValue, Maybe HttpGatewayRouteRewriteProperty
()
haddock_workaround_ :: ()
rewrite :: Maybe HttpGatewayRouteRewriteProperty
haddock_workaround_ :: ()
rewrite :: Maybe HttpGatewayRouteRewriteProperty
..}