module Stratosphere.CloudFront.ContinuousDeploymentPolicy.TrafficConfigProperty (
        module Exports, TrafficConfigProperty(..), mkTrafficConfigProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.CloudFront.ContinuousDeploymentPolicy.SingleHeaderConfigProperty as Exports
import {-# SOURCE #-} Stratosphere.CloudFront.ContinuousDeploymentPolicy.SingleWeightConfigProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data TrafficConfigProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html>
    TrafficConfigProperty {TrafficConfigProperty -> ()
haddock_workaround_ :: (),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html#cfn-cloudfront-continuousdeploymentpolicy-trafficconfig-singleheaderconfig>
                           TrafficConfigProperty -> Maybe SingleHeaderConfigProperty
singleHeaderConfig :: (Prelude.Maybe SingleHeaderConfigProperty),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html#cfn-cloudfront-continuousdeploymentpolicy-trafficconfig-singleweightconfig>
                           TrafficConfigProperty -> Maybe SingleWeightConfigProperty
singleWeightConfig :: (Prelude.Maybe SingleWeightConfigProperty),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html#cfn-cloudfront-continuousdeploymentpolicy-trafficconfig-type>
                           TrafficConfigProperty -> Value Text
type' :: (Value Prelude.Text)}
  deriving stock (TrafficConfigProperty -> TrafficConfigProperty -> Bool
(TrafficConfigProperty -> TrafficConfigProperty -> Bool)
-> (TrafficConfigProperty -> TrafficConfigProperty -> Bool)
-> Eq TrafficConfigProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TrafficConfigProperty -> TrafficConfigProperty -> Bool
== :: TrafficConfigProperty -> TrafficConfigProperty -> Bool
$c/= :: TrafficConfigProperty -> TrafficConfigProperty -> Bool
/= :: TrafficConfigProperty -> TrafficConfigProperty -> Bool
Prelude.Eq, Int -> TrafficConfigProperty -> ShowS
[TrafficConfigProperty] -> ShowS
TrafficConfigProperty -> String
(Int -> TrafficConfigProperty -> ShowS)
-> (TrafficConfigProperty -> String)
-> ([TrafficConfigProperty] -> ShowS)
-> Show TrafficConfigProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TrafficConfigProperty -> ShowS
showsPrec :: Int -> TrafficConfigProperty -> ShowS
$cshow :: TrafficConfigProperty -> String
show :: TrafficConfigProperty -> String
$cshowList :: [TrafficConfigProperty] -> ShowS
showList :: [TrafficConfigProperty] -> ShowS
Prelude.Show)
mkTrafficConfigProperty ::
  Value Prelude.Text -> TrafficConfigProperty
mkTrafficConfigProperty :: Value Text -> TrafficConfigProperty
mkTrafficConfigProperty Value Text
type'
  = TrafficConfigProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), type' :: Value Text
type' = Value Text
type',
       singleHeaderConfig :: Maybe SingleHeaderConfigProperty
singleHeaderConfig = Maybe SingleHeaderConfigProperty
forall a. Maybe a
Prelude.Nothing,
       singleWeightConfig :: Maybe SingleWeightConfigProperty
singleWeightConfig = Maybe SingleWeightConfigProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties TrafficConfigProperty where
  toResourceProperties :: TrafficConfigProperty -> ResourceProperties
toResourceProperties TrafficConfigProperty {Maybe SingleHeaderConfigProperty
Maybe SingleWeightConfigProperty
()
Value Text
haddock_workaround_ :: TrafficConfigProperty -> ()
singleHeaderConfig :: TrafficConfigProperty -> Maybe SingleHeaderConfigProperty
singleWeightConfig :: TrafficConfigProperty -> Maybe SingleWeightConfigProperty
type' :: TrafficConfigProperty -> Value Text
haddock_workaround_ :: ()
singleHeaderConfig :: Maybe SingleHeaderConfigProperty
singleWeightConfig :: Maybe SingleWeightConfigProperty
type' :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudFront::ContinuousDeploymentPolicy.TrafficConfig",
         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
"Type" 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
type']
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> SingleHeaderConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SingleHeaderConfig" (SingleHeaderConfigProperty -> (Key, Value))
-> Maybe SingleHeaderConfigProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SingleHeaderConfigProperty
singleHeaderConfig,
                               Key -> SingleWeightConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SingleWeightConfig" (SingleWeightConfigProperty -> (Key, Value))
-> Maybe SingleWeightConfigProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SingleWeightConfigProperty
singleWeightConfig]))}
instance JSON.ToJSON TrafficConfigProperty where
  toJSON :: TrafficConfigProperty -> Value
toJSON TrafficConfigProperty {Maybe SingleHeaderConfigProperty
Maybe SingleWeightConfigProperty
()
Value Text
haddock_workaround_ :: TrafficConfigProperty -> ()
singleHeaderConfig :: TrafficConfigProperty -> Maybe SingleHeaderConfigProperty
singleWeightConfig :: TrafficConfigProperty -> Maybe SingleWeightConfigProperty
type' :: TrafficConfigProperty -> Value Text
haddock_workaround_ :: ()
singleHeaderConfig :: Maybe SingleHeaderConfigProperty
singleWeightConfig :: Maybe SingleWeightConfigProperty
type' :: Value Text
..}
    = [(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
"Type" 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
type']
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> SingleHeaderConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SingleHeaderConfig" (SingleHeaderConfigProperty -> (Key, Value))
-> Maybe SingleHeaderConfigProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SingleHeaderConfigProperty
singleHeaderConfig,
                  Key -> SingleWeightConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SingleWeightConfig" (SingleWeightConfigProperty -> (Key, Value))
-> Maybe SingleWeightConfigProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SingleWeightConfigProperty
singleWeightConfig])))
instance Property "SingleHeaderConfig" TrafficConfigProperty where
  type PropertyType "SingleHeaderConfig" TrafficConfigProperty = SingleHeaderConfigProperty
  set :: PropertyType "SingleHeaderConfig" TrafficConfigProperty
-> TrafficConfigProperty -> TrafficConfigProperty
set PropertyType "SingleHeaderConfig" TrafficConfigProperty
newValue TrafficConfigProperty {Maybe SingleHeaderConfigProperty
Maybe SingleWeightConfigProperty
()
Value Text
haddock_workaround_ :: TrafficConfigProperty -> ()
singleHeaderConfig :: TrafficConfigProperty -> Maybe SingleHeaderConfigProperty
singleWeightConfig :: TrafficConfigProperty -> Maybe SingleWeightConfigProperty
type' :: TrafficConfigProperty -> Value Text
haddock_workaround_ :: ()
singleHeaderConfig :: Maybe SingleHeaderConfigProperty
singleWeightConfig :: Maybe SingleWeightConfigProperty
type' :: Value Text
..}
    = TrafficConfigProperty
        {singleHeaderConfig :: Maybe SingleHeaderConfigProperty
singleHeaderConfig = SingleHeaderConfigProperty -> Maybe SingleHeaderConfigProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SingleHeaderConfig" TrafficConfigProperty
SingleHeaderConfigProperty
newValue, Maybe SingleWeightConfigProperty
()
Value Text
haddock_workaround_ :: ()
singleWeightConfig :: Maybe SingleWeightConfigProperty
type' :: Value Text
haddock_workaround_ :: ()
singleWeightConfig :: Maybe SingleWeightConfigProperty
type' :: Value Text
..}
instance Property "SingleWeightConfig" TrafficConfigProperty where
  type PropertyType "SingleWeightConfig" TrafficConfigProperty = SingleWeightConfigProperty
  set :: PropertyType "SingleWeightConfig" TrafficConfigProperty
-> TrafficConfigProperty -> TrafficConfigProperty
set PropertyType "SingleWeightConfig" TrafficConfigProperty
newValue TrafficConfigProperty {Maybe SingleHeaderConfigProperty
Maybe SingleWeightConfigProperty
()
Value Text
haddock_workaround_ :: TrafficConfigProperty -> ()
singleHeaderConfig :: TrafficConfigProperty -> Maybe SingleHeaderConfigProperty
singleWeightConfig :: TrafficConfigProperty -> Maybe SingleWeightConfigProperty
type' :: TrafficConfigProperty -> Value Text
haddock_workaround_ :: ()
singleHeaderConfig :: Maybe SingleHeaderConfigProperty
singleWeightConfig :: Maybe SingleWeightConfigProperty
type' :: Value Text
..}
    = TrafficConfigProperty
        {singleWeightConfig :: Maybe SingleWeightConfigProperty
singleWeightConfig = SingleWeightConfigProperty -> Maybe SingleWeightConfigProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SingleWeightConfig" TrafficConfigProperty
SingleWeightConfigProperty
newValue, Maybe SingleHeaderConfigProperty
()
Value Text
haddock_workaround_ :: ()
singleHeaderConfig :: Maybe SingleHeaderConfigProperty
type' :: Value Text
haddock_workaround_ :: ()
singleHeaderConfig :: Maybe SingleHeaderConfigProperty
type' :: Value Text
..}
instance Property "Type" TrafficConfigProperty where
  type PropertyType "Type" TrafficConfigProperty = Value Prelude.Text
  set :: PropertyType "Type" TrafficConfigProperty
-> TrafficConfigProperty -> TrafficConfigProperty
set PropertyType "Type" TrafficConfigProperty
newValue TrafficConfigProperty {Maybe SingleHeaderConfigProperty
Maybe SingleWeightConfigProperty
()
Value Text
haddock_workaround_ :: TrafficConfigProperty -> ()
singleHeaderConfig :: TrafficConfigProperty -> Maybe SingleHeaderConfigProperty
singleWeightConfig :: TrafficConfigProperty -> Maybe SingleWeightConfigProperty
type' :: TrafficConfigProperty -> Value Text
haddock_workaround_ :: ()
singleHeaderConfig :: Maybe SingleHeaderConfigProperty
singleWeightConfig :: Maybe SingleWeightConfigProperty
type' :: Value Text
..}
    = TrafficConfigProperty {type' :: Value Text
type' = PropertyType "Type" TrafficConfigProperty
Value Text
newValue, Maybe SingleHeaderConfigProperty
Maybe SingleWeightConfigProperty
()
haddock_workaround_ :: ()
singleHeaderConfig :: Maybe SingleHeaderConfigProperty
singleWeightConfig :: Maybe SingleWeightConfigProperty
haddock_workaround_ :: ()
singleHeaderConfig :: Maybe SingleHeaderConfigProperty
singleWeightConfig :: Maybe SingleWeightConfigProperty
..}