module Stratosphere.MediaLive.Network.RouteProperty (
        RouteProperty(..), mkRouteProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data RouteProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-network-route.html>
    RouteProperty {RouteProperty -> ()
haddock_workaround_ :: (),
                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-network-route.html#cfn-medialive-network-route-cidr>
                   RouteProperty -> Maybe (Value Text)
cidr :: (Prelude.Maybe (Value Prelude.Text)),
                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-network-route.html#cfn-medialive-network-route-gateway>
                   RouteProperty -> Maybe (Value Text)
gateway :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (RouteProperty -> RouteProperty -> Bool
(RouteProperty -> RouteProperty -> Bool)
-> (RouteProperty -> RouteProperty -> Bool) -> Eq RouteProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RouteProperty -> RouteProperty -> Bool
== :: RouteProperty -> RouteProperty -> Bool
$c/= :: RouteProperty -> RouteProperty -> Bool
/= :: RouteProperty -> RouteProperty -> Bool
Prelude.Eq, Int -> RouteProperty -> ShowS
[RouteProperty] -> ShowS
RouteProperty -> String
(Int -> RouteProperty -> ShowS)
-> (RouteProperty -> String)
-> ([RouteProperty] -> ShowS)
-> Show RouteProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RouteProperty -> ShowS
showsPrec :: Int -> RouteProperty -> ShowS
$cshow :: RouteProperty -> String
show :: RouteProperty -> String
$cshowList :: [RouteProperty] -> ShowS
showList :: [RouteProperty] -> ShowS
Prelude.Show)
mkRouteProperty :: RouteProperty
mkRouteProperty :: RouteProperty
mkRouteProperty
  = RouteProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), cidr :: Maybe (Value Text)
cidr = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       gateway :: Maybe (Value Text)
gateway = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties RouteProperty where
  toResourceProperties :: RouteProperty -> ResourceProperties
toResourceProperties RouteProperty {Maybe (Value Text)
()
haddock_workaround_ :: RouteProperty -> ()
cidr :: RouteProperty -> Maybe (Value Text)
gateway :: RouteProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
cidr :: Maybe (Value Text)
gateway :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::MediaLive::Network.Route",
         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 -> 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
"Cidr" (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)
cidr,
                            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
"Gateway" (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)
gateway])}
instance JSON.ToJSON RouteProperty where
  toJSON :: RouteProperty -> Value
toJSON RouteProperty {Maybe (Value Text)
()
haddock_workaround_ :: RouteProperty -> ()
cidr :: RouteProperty -> Maybe (Value Text)
gateway :: RouteProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
cidr :: Maybe (Value Text)
gateway :: Maybe (Value Text)
..}
    = [(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 -> 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
"Cidr" (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)
cidr,
               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
"Gateway" (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)
gateway]))
instance Property "Cidr" RouteProperty where
  type PropertyType "Cidr" RouteProperty = Value Prelude.Text
  set :: PropertyType "Cidr" RouteProperty -> RouteProperty -> RouteProperty
set PropertyType "Cidr" RouteProperty
newValue RouteProperty {Maybe (Value Text)
()
haddock_workaround_ :: RouteProperty -> ()
cidr :: RouteProperty -> Maybe (Value Text)
gateway :: RouteProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
cidr :: Maybe (Value Text)
gateway :: Maybe (Value Text)
..}
    = RouteProperty {cidr :: Maybe (Value Text)
cidr = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Cidr" RouteProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
gateway :: Maybe (Value Text)
haddock_workaround_ :: ()
gateway :: Maybe (Value Text)
..}
instance Property "Gateway" RouteProperty where
  type PropertyType "Gateway" RouteProperty = Value Prelude.Text
  set :: PropertyType "Gateway" RouteProperty
-> RouteProperty -> RouteProperty
set PropertyType "Gateway" RouteProperty
newValue RouteProperty {Maybe (Value Text)
()
haddock_workaround_ :: RouteProperty -> ()
cidr :: RouteProperty -> Maybe (Value Text)
gateway :: RouteProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
cidr :: Maybe (Value Text)
gateway :: Maybe (Value Text)
..}
    = RouteProperty {gateway :: Maybe (Value Text)
gateway = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Gateway" RouteProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
cidr :: Maybe (Value Text)
haddock_workaround_ :: ()
cidr :: Maybe (Value Text)
..}