module Stratosphere.CloudFront.Distribution.OriginGroupsProperty (
        module Exports, OriginGroupsProperty(..), mkOriginGroupsProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.CloudFront.Distribution.OriginGroupProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data OriginGroupsProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroups.html>
    OriginGroupsProperty {OriginGroupsProperty -> ()
haddock_workaround_ :: (),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroups.html#cfn-cloudfront-distribution-origingroups-items>
                          OriginGroupsProperty -> Maybe [OriginGroupProperty]
items :: (Prelude.Maybe [OriginGroupProperty]),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroups.html#cfn-cloudfront-distribution-origingroups-quantity>
                          OriginGroupsProperty -> Value Integer
quantity :: (Value Prelude.Integer)}
  deriving stock (OriginGroupsProperty -> OriginGroupsProperty -> Bool
(OriginGroupsProperty -> OriginGroupsProperty -> Bool)
-> (OriginGroupsProperty -> OriginGroupsProperty -> Bool)
-> Eq OriginGroupsProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OriginGroupsProperty -> OriginGroupsProperty -> Bool
== :: OriginGroupsProperty -> OriginGroupsProperty -> Bool
$c/= :: OriginGroupsProperty -> OriginGroupsProperty -> Bool
/= :: OriginGroupsProperty -> OriginGroupsProperty -> Bool
Prelude.Eq, Int -> OriginGroupsProperty -> ShowS
[OriginGroupsProperty] -> ShowS
OriginGroupsProperty -> String
(Int -> OriginGroupsProperty -> ShowS)
-> (OriginGroupsProperty -> String)
-> ([OriginGroupsProperty] -> ShowS)
-> Show OriginGroupsProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OriginGroupsProperty -> ShowS
showsPrec :: Int -> OriginGroupsProperty -> ShowS
$cshow :: OriginGroupsProperty -> String
show :: OriginGroupsProperty -> String
$cshowList :: [OriginGroupsProperty] -> ShowS
showList :: [OriginGroupsProperty] -> ShowS
Prelude.Show)
mkOriginGroupsProperty ::
  Value Prelude.Integer -> OriginGroupsProperty
mkOriginGroupsProperty :: Value Integer -> OriginGroupsProperty
mkOriginGroupsProperty Value Integer
quantity
  = OriginGroupsProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), quantity :: Value Integer
quantity = Value Integer
quantity,
       items :: Maybe [OriginGroupProperty]
items = Maybe [OriginGroupProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties OriginGroupsProperty where
  toResourceProperties :: OriginGroupsProperty -> ResourceProperties
toResourceProperties OriginGroupsProperty {Maybe [OriginGroupProperty]
()
Value Integer
haddock_workaround_ :: OriginGroupsProperty -> ()
items :: OriginGroupsProperty -> Maybe [OriginGroupProperty]
quantity :: OriginGroupsProperty -> Value Integer
haddock_workaround_ :: ()
items :: Maybe [OriginGroupProperty]
quantity :: Value Integer
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CloudFront::Distribution.OriginGroups",
         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
"Quantity" 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..= Value Integer
quantity]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [OriginGroupProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Items" ([OriginGroupProperty] -> (Key, Value))
-> Maybe [OriginGroupProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [OriginGroupProperty]
items]))}
instance JSON.ToJSON OriginGroupsProperty where
  toJSON :: OriginGroupsProperty -> Value
toJSON OriginGroupsProperty {Maybe [OriginGroupProperty]
()
Value Integer
haddock_workaround_ :: OriginGroupsProperty -> ()
items :: OriginGroupsProperty -> Maybe [OriginGroupProperty]
quantity :: OriginGroupsProperty -> Value Integer
haddock_workaround_ :: ()
items :: Maybe [OriginGroupProperty]
quantity :: 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
"Quantity" 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..= Value Integer
quantity]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [OriginGroupProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Items" ([OriginGroupProperty] -> (Key, Value))
-> Maybe [OriginGroupProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [OriginGroupProperty]
items])))
instance Property "Items" OriginGroupsProperty where
  type PropertyType "Items" OriginGroupsProperty = [OriginGroupProperty]
  set :: PropertyType "Items" OriginGroupsProperty
-> OriginGroupsProperty -> OriginGroupsProperty
set PropertyType "Items" OriginGroupsProperty
newValue OriginGroupsProperty {Maybe [OriginGroupProperty]
()
Value Integer
haddock_workaround_ :: OriginGroupsProperty -> ()
items :: OriginGroupsProperty -> Maybe [OriginGroupProperty]
quantity :: OriginGroupsProperty -> Value Integer
haddock_workaround_ :: ()
items :: Maybe [OriginGroupProperty]
quantity :: Value Integer
..}
    = OriginGroupsProperty {items :: Maybe [OriginGroupProperty]
items = [OriginGroupProperty] -> Maybe [OriginGroupProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [OriginGroupProperty]
PropertyType "Items" OriginGroupsProperty
newValue, ()
Value Integer
haddock_workaround_ :: ()
quantity :: Value Integer
haddock_workaround_ :: ()
quantity :: Value Integer
..}
instance Property "Quantity" OriginGroupsProperty where
  type PropertyType "Quantity" OriginGroupsProperty = Value Prelude.Integer
  set :: PropertyType "Quantity" OriginGroupsProperty
-> OriginGroupsProperty -> OriginGroupsProperty
set PropertyType "Quantity" OriginGroupsProperty
newValue OriginGroupsProperty {Maybe [OriginGroupProperty]
()
Value Integer
haddock_workaround_ :: OriginGroupsProperty -> ()
items :: OriginGroupsProperty -> Maybe [OriginGroupProperty]
quantity :: OriginGroupsProperty -> Value Integer
haddock_workaround_ :: ()
items :: Maybe [OriginGroupProperty]
quantity :: Value Integer
..}
    = OriginGroupsProperty {quantity :: Value Integer
quantity = PropertyType "Quantity" OriginGroupsProperty
Value Integer
newValue, Maybe [OriginGroupProperty]
()
haddock_workaround_ :: ()
items :: Maybe [OriginGroupProperty]
haddock_workaround_ :: ()
items :: Maybe [OriginGroupProperty]
..}