module Stratosphere.MediaLive.Network (
        module Exports, Network(..), mkNetwork
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.MediaLive.Network.IpPoolProperty as Exports
import {-# SOURCE #-} Stratosphere.MediaLive.Network.RouteProperty as Exports
import {-# SOURCE #-} Stratosphere.MediaLive.Network.TagsProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Network
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-medialive-network.html>
    Network {Network -> ()
haddock_workaround_ :: (),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-medialive-network.html#cfn-medialive-network-ippools>
             Network -> [IpPoolProperty]
ipPools :: [IpPoolProperty],
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-medialive-network.html#cfn-medialive-network-name>
             Network -> Value Text
name :: (Value Prelude.Text),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-medialive-network.html#cfn-medialive-network-routes>
             Network -> Maybe [RouteProperty]
routes :: (Prelude.Maybe [RouteProperty]),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-medialive-network.html#cfn-medialive-network-tags>
             Network -> Maybe [TagsProperty]
tags :: (Prelude.Maybe [TagsProperty])}
  deriving stock (Network -> Network -> Bool
(Network -> Network -> Bool)
-> (Network -> Network -> Bool) -> Eq Network
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Network -> Network -> Bool
== :: Network -> Network -> Bool
$c/= :: Network -> Network -> Bool
/= :: Network -> Network -> Bool
Prelude.Eq, Int -> Network -> ShowS
[Network] -> ShowS
Network -> String
(Int -> Network -> ShowS)
-> (Network -> String) -> ([Network] -> ShowS) -> Show Network
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Network -> ShowS
showsPrec :: Int -> Network -> ShowS
$cshow :: Network -> String
show :: Network -> String
$cshowList :: [Network] -> ShowS
showList :: [Network] -> ShowS
Prelude.Show)
mkNetwork :: [IpPoolProperty] -> Value Prelude.Text -> Network
mkNetwork :: [IpPoolProperty] -> Value Text -> Network
mkNetwork [IpPoolProperty]
ipPools Value Text
name
  = Network
      {haddock_workaround_ :: ()
haddock_workaround_ = (), ipPools :: [IpPoolProperty]
ipPools = [IpPoolProperty]
ipPools, name :: Value Text
name = Value Text
name,
       routes :: Maybe [RouteProperty]
routes = Maybe [RouteProperty]
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [TagsProperty]
tags = Maybe [TagsProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Network where
  toResourceProperties :: Network -> ResourceProperties
toResourceProperties Network {[IpPoolProperty]
Maybe [RouteProperty]
Maybe [TagsProperty]
()
Value Text
haddock_workaround_ :: Network -> ()
ipPools :: Network -> [IpPoolProperty]
name :: Network -> Value Text
routes :: Network -> Maybe [RouteProperty]
tags :: Network -> Maybe [TagsProperty]
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::MediaLive::Network", 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
"IpPools" Key -> [IpPoolProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [IpPoolProperty]
ipPools, Key
"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..= Value Text
name]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> [RouteProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Routes" ([RouteProperty] -> (Key, Value))
-> Maybe [RouteProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteProperty]
routes,
                               Key -> [TagsProperty] -> (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" ([TagsProperty] -> (Key, Value))
-> Maybe [TagsProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagsProperty]
tags]))}
instance JSON.ToJSON Network where
  toJSON :: Network -> Value
toJSON Network {[IpPoolProperty]
Maybe [RouteProperty]
Maybe [TagsProperty]
()
Value Text
haddock_workaround_ :: Network -> ()
ipPools :: Network -> [IpPoolProperty]
name :: Network -> Value Text
routes :: Network -> Maybe [RouteProperty]
tags :: Network -> Maybe [TagsProperty]
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
..}
    = [(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
"IpPools" Key -> [IpPoolProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [IpPoolProperty]
ipPools, Key
"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..= Value Text
name]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> [RouteProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Routes" ([RouteProperty] -> (Key, Value))
-> Maybe [RouteProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteProperty]
routes,
                  Key -> [TagsProperty] -> (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" ([TagsProperty] -> (Key, Value))
-> Maybe [TagsProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagsProperty]
tags])))
instance Property "IpPools" Network where
  type PropertyType "IpPools" Network = [IpPoolProperty]
  set :: PropertyType "IpPools" Network -> Network -> Network
set PropertyType "IpPools" Network
newValue Network {[IpPoolProperty]
Maybe [RouteProperty]
Maybe [TagsProperty]
()
Value Text
haddock_workaround_ :: Network -> ()
ipPools :: Network -> [IpPoolProperty]
name :: Network -> Value Text
routes :: Network -> Maybe [RouteProperty]
tags :: Network -> Maybe [TagsProperty]
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
..} = Network {ipPools :: [IpPoolProperty]
ipPools = [IpPoolProperty]
PropertyType "IpPools" Network
newValue, Maybe [RouteProperty]
Maybe [TagsProperty]
()
Value Text
haddock_workaround_ :: ()
name :: Value Text
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
haddock_workaround_ :: ()
name :: Value Text
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
..}
instance Property "Name" Network where
  type PropertyType "Name" Network = Value Prelude.Text
  set :: PropertyType "Name" Network -> Network -> Network
set PropertyType "Name" Network
newValue Network {[IpPoolProperty]
Maybe [RouteProperty]
Maybe [TagsProperty]
()
Value Text
haddock_workaround_ :: Network -> ()
ipPools :: Network -> [IpPoolProperty]
name :: Network -> Value Text
routes :: Network -> Maybe [RouteProperty]
tags :: Network -> Maybe [TagsProperty]
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
..} = Network {name :: Value Text
name = PropertyType "Name" Network
Value Text
newValue, [IpPoolProperty]
Maybe [RouteProperty]
Maybe [TagsProperty]
()
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
..}
instance Property "Routes" Network where
  type PropertyType "Routes" Network = [RouteProperty]
  set :: PropertyType "Routes" Network -> Network -> Network
set PropertyType "Routes" Network
newValue Network {[IpPoolProperty]
Maybe [RouteProperty]
Maybe [TagsProperty]
()
Value Text
haddock_workaround_ :: Network -> ()
ipPools :: Network -> [IpPoolProperty]
name :: Network -> Value Text
routes :: Network -> Maybe [RouteProperty]
tags :: Network -> Maybe [TagsProperty]
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
..}
    = Network {routes :: Maybe [RouteProperty]
routes = [RouteProperty] -> Maybe [RouteProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [RouteProperty]
PropertyType "Routes" Network
newValue, [IpPoolProperty]
Maybe [TagsProperty]
()
Value Text
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
tags :: Maybe [TagsProperty]
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
tags :: Maybe [TagsProperty]
..}
instance Property "Tags" Network where
  type PropertyType "Tags" Network = [TagsProperty]
  set :: PropertyType "Tags" Network -> Network -> Network
set PropertyType "Tags" Network
newValue Network {[IpPoolProperty]
Maybe [RouteProperty]
Maybe [TagsProperty]
()
Value Text
haddock_workaround_ :: Network -> ()
ipPools :: Network -> [IpPoolProperty]
name :: Network -> Value Text
routes :: Network -> Maybe [RouteProperty]
tags :: Network -> Maybe [TagsProperty]
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
routes :: Maybe [RouteProperty]
tags :: Maybe [TagsProperty]
..}
    = Network {tags :: Maybe [TagsProperty]
tags = [TagsProperty] -> Maybe [TagsProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [TagsProperty]
PropertyType "Tags" Network
newValue, [IpPoolProperty]
Maybe [RouteProperty]
()
Value Text
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
routes :: Maybe [RouteProperty]
haddock_workaround_ :: ()
ipPools :: [IpPoolProperty]
name :: Value Text
routes :: Maybe [RouteProperty]
..}