module Stratosphere.VpcLattice.Listener.WeightedTargetGroupProperty (
        WeightedTargetGroupProperty(..), mkWeightedTargetGroupProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data WeightedTargetGroupProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-listener-weightedtargetgroup.html>
    WeightedTargetGroupProperty {WeightedTargetGroupProperty -> ()
haddock_workaround_ :: (),
                                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-listener-weightedtargetgroup.html#cfn-vpclattice-listener-weightedtargetgroup-targetgroupidentifier>
                                 WeightedTargetGroupProperty -> Value Text
targetGroupIdentifier :: (Value Prelude.Text),
                                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-vpclattice-listener-weightedtargetgroup.html#cfn-vpclattice-listener-weightedtargetgroup-weight>
                                 WeightedTargetGroupProperty -> Maybe (Value Integer)
weight :: (Prelude.Maybe (Value Prelude.Integer))}
  deriving stock (WeightedTargetGroupProperty -> WeightedTargetGroupProperty -> Bool
(WeightedTargetGroupProperty
 -> WeightedTargetGroupProperty -> Bool)
-> (WeightedTargetGroupProperty
    -> WeightedTargetGroupProperty -> Bool)
-> Eq WeightedTargetGroupProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WeightedTargetGroupProperty -> WeightedTargetGroupProperty -> Bool
== :: WeightedTargetGroupProperty -> WeightedTargetGroupProperty -> Bool
$c/= :: WeightedTargetGroupProperty -> WeightedTargetGroupProperty -> Bool
/= :: WeightedTargetGroupProperty -> WeightedTargetGroupProperty -> Bool
Prelude.Eq, Int -> WeightedTargetGroupProperty -> ShowS
[WeightedTargetGroupProperty] -> ShowS
WeightedTargetGroupProperty -> String
(Int -> WeightedTargetGroupProperty -> ShowS)
-> (WeightedTargetGroupProperty -> String)
-> ([WeightedTargetGroupProperty] -> ShowS)
-> Show WeightedTargetGroupProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WeightedTargetGroupProperty -> ShowS
showsPrec :: Int -> WeightedTargetGroupProperty -> ShowS
$cshow :: WeightedTargetGroupProperty -> String
show :: WeightedTargetGroupProperty -> String
$cshowList :: [WeightedTargetGroupProperty] -> ShowS
showList :: [WeightedTargetGroupProperty] -> ShowS
Prelude.Show)
mkWeightedTargetGroupProperty ::
  Value Prelude.Text -> WeightedTargetGroupProperty
mkWeightedTargetGroupProperty :: Value Text -> WeightedTargetGroupProperty
mkWeightedTargetGroupProperty Value Text
targetGroupIdentifier
  = WeightedTargetGroupProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       targetGroupIdentifier :: Value Text
targetGroupIdentifier = Value Text
targetGroupIdentifier,
       weight :: Maybe (Value Integer)
weight = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties WeightedTargetGroupProperty where
  toResourceProperties :: WeightedTargetGroupProperty -> ResourceProperties
toResourceProperties WeightedTargetGroupProperty {Maybe (Value Integer)
()
Value Text
haddock_workaround_ :: WeightedTargetGroupProperty -> ()
targetGroupIdentifier :: WeightedTargetGroupProperty -> Value Text
weight :: WeightedTargetGroupProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
targetGroupIdentifier :: Value Text
weight :: Maybe (Value Integer)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::VpcLattice::Listener.WeightedTargetGroup",
         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
"TargetGroupIdentifier" 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
targetGroupIdentifier]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Weight" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
weight]))}
instance JSON.ToJSON WeightedTargetGroupProperty where
  toJSON :: WeightedTargetGroupProperty -> Value
toJSON WeightedTargetGroupProperty {Maybe (Value Integer)
()
Value Text
haddock_workaround_ :: WeightedTargetGroupProperty -> ()
targetGroupIdentifier :: WeightedTargetGroupProperty -> Value Text
weight :: WeightedTargetGroupProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
targetGroupIdentifier :: Value Text
weight :: Maybe (Value Integer)
..}
    = [(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
"TargetGroupIdentifier" 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
targetGroupIdentifier]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Weight" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
weight])))
instance Property "TargetGroupIdentifier" WeightedTargetGroupProperty where
  type PropertyType "TargetGroupIdentifier" WeightedTargetGroupProperty = Value Prelude.Text
  set :: PropertyType "TargetGroupIdentifier" WeightedTargetGroupProperty
-> WeightedTargetGroupProperty -> WeightedTargetGroupProperty
set PropertyType "TargetGroupIdentifier" WeightedTargetGroupProperty
newValue WeightedTargetGroupProperty {Maybe (Value Integer)
()
Value Text
haddock_workaround_ :: WeightedTargetGroupProperty -> ()
targetGroupIdentifier :: WeightedTargetGroupProperty -> Value Text
weight :: WeightedTargetGroupProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
targetGroupIdentifier :: Value Text
weight :: Maybe (Value Integer)
..}
    = WeightedTargetGroupProperty
        {targetGroupIdentifier :: Value Text
targetGroupIdentifier = PropertyType "TargetGroupIdentifier" WeightedTargetGroupProperty
Value Text
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
weight :: Maybe (Value Integer)
haddock_workaround_ :: ()
weight :: Maybe (Value Integer)
..}
instance Property "Weight" WeightedTargetGroupProperty where
  type PropertyType "Weight" WeightedTargetGroupProperty = Value Prelude.Integer
  set :: PropertyType "Weight" WeightedTargetGroupProperty
-> WeightedTargetGroupProperty -> WeightedTargetGroupProperty
set PropertyType "Weight" WeightedTargetGroupProperty
newValue WeightedTargetGroupProperty {Maybe (Value Integer)
()
Value Text
haddock_workaround_ :: WeightedTargetGroupProperty -> ()
targetGroupIdentifier :: WeightedTargetGroupProperty -> Value Text
weight :: WeightedTargetGroupProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
targetGroupIdentifier :: Value Text
weight :: Maybe (Value Integer)
..}
    = WeightedTargetGroupProperty {weight :: Maybe (Value Integer)
weight = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Weight" WeightedTargetGroupProperty
Value Integer
newValue, ()
Value Text
haddock_workaround_ :: ()
targetGroupIdentifier :: Value Text
haddock_workaround_ :: ()
targetGroupIdentifier :: Value Text
..}