module Stratosphere.ImageBuilder.DistributionConfiguration (
        module Exports, DistributionConfiguration(..),
        mkDistributionConfiguration
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.ImageBuilder.DistributionConfiguration.DistributionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data DistributionConfiguration
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-distributionconfiguration.html>
    DistributionConfiguration {DistributionConfiguration -> ()
haddock_workaround_ :: (),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-distributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-description>
                               DistributionConfiguration -> Maybe (Value Text)
description :: (Prelude.Maybe (Value Prelude.Text)),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-distributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-distributions>
                               DistributionConfiguration -> [DistributionProperty]
distributions :: [DistributionProperty],
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-distributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-name>
                               DistributionConfiguration -> Value Text
name :: (Value Prelude.Text),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-imagebuilder-distributionconfiguration.html#cfn-imagebuilder-distributionconfiguration-tags>
                               DistributionConfiguration -> Maybe (Map Text (Value Text))
tags :: (Prelude.Maybe (Prelude.Map Prelude.Text (Value Prelude.Text)))}
  deriving stock (DistributionConfiguration -> DistributionConfiguration -> Bool
(DistributionConfiguration -> DistributionConfiguration -> Bool)
-> (DistributionConfiguration -> DistributionConfiguration -> Bool)
-> Eq DistributionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DistributionConfiguration -> DistributionConfiguration -> Bool
== :: DistributionConfiguration -> DistributionConfiguration -> Bool
$c/= :: DistributionConfiguration -> DistributionConfiguration -> Bool
/= :: DistributionConfiguration -> DistributionConfiguration -> Bool
Prelude.Eq, Int -> DistributionConfiguration -> ShowS
[DistributionConfiguration] -> ShowS
DistributionConfiguration -> String
(Int -> DistributionConfiguration -> ShowS)
-> (DistributionConfiguration -> String)
-> ([DistributionConfiguration] -> ShowS)
-> Show DistributionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DistributionConfiguration -> ShowS
showsPrec :: Int -> DistributionConfiguration -> ShowS
$cshow :: DistributionConfiguration -> String
show :: DistributionConfiguration -> String
$cshowList :: [DistributionConfiguration] -> ShowS
showList :: [DistributionConfiguration] -> ShowS
Prelude.Show)
mkDistributionConfiguration ::
  [DistributionProperty]
  -> Value Prelude.Text -> DistributionConfiguration
mkDistributionConfiguration :: [DistributionProperty] -> Value Text -> DistributionConfiguration
mkDistributionConfiguration [DistributionProperty]
distributions Value Text
name
  = DistributionConfiguration
      {haddock_workaround_ :: ()
haddock_workaround_ = (), distributions :: [DistributionProperty]
distributions = [DistributionProperty]
distributions,
       name :: Value Text
name = Value Text
name, description :: Maybe (Value Text)
description = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, tags :: Maybe (Map Text (Value Text))
tags = Maybe (Map Text (Value Text))
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DistributionConfiguration where
  toResourceProperties :: DistributionConfiguration -> ResourceProperties
toResourceProperties DistributionConfiguration {[DistributionProperty]
Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DistributionConfiguration -> ()
description :: DistributionConfiguration -> Maybe (Value Text)
distributions :: DistributionConfiguration -> [DistributionProperty]
name :: DistributionConfiguration -> Value Text
tags :: DistributionConfiguration -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::ImageBuilder::DistributionConfiguration",
         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
"Distributions" Key -> [DistributionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [DistributionProperty]
distributions, 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 -> 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
"Description" (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)
description,
                               Key -> Map Text (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
"Tags" (Map Text (Value Text) -> (Key, Value))
-> Maybe (Map Text (Value Text)) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text (Value Text))
tags]))}
instance JSON.ToJSON DistributionConfiguration where
  toJSON :: DistributionConfiguration -> Value
toJSON DistributionConfiguration {[DistributionProperty]
Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DistributionConfiguration -> ()
description :: DistributionConfiguration -> Maybe (Value Text)
distributions :: DistributionConfiguration -> [DistributionProperty]
name :: DistributionConfiguration -> Value Text
tags :: DistributionConfiguration -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
name :: Value Text
tags :: Maybe (Map Text (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
"Distributions" Key -> [DistributionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= [DistributionProperty]
distributions, 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 -> 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
"Description" (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)
description,
                  Key -> Map Text (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
"Tags" (Map Text (Value Text) -> (Key, Value))
-> Maybe (Map Text (Value Text)) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text (Value Text))
tags])))
instance Property "Description" DistributionConfiguration where
  type PropertyType "Description" DistributionConfiguration = Value Prelude.Text
  set :: PropertyType "Description" DistributionConfiguration
-> DistributionConfiguration -> DistributionConfiguration
set PropertyType "Description" DistributionConfiguration
newValue DistributionConfiguration {[DistributionProperty]
Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DistributionConfiguration -> ()
description :: DistributionConfiguration -> Maybe (Value Text)
distributions :: DistributionConfiguration -> [DistributionProperty]
name :: DistributionConfiguration -> Value Text
tags :: DistributionConfiguration -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
    = DistributionConfiguration
        {description :: Maybe (Value Text)
description = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Description" DistributionConfiguration
Value Text
newValue, [DistributionProperty]
Maybe (Map Text (Value Text))
()
Value Text
haddock_workaround_ :: ()
distributions :: [DistributionProperty]
name :: Value Text
tags :: Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
distributions :: [DistributionProperty]
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
instance Property "Distributions" DistributionConfiguration where
  type PropertyType "Distributions" DistributionConfiguration = [DistributionProperty]
  set :: PropertyType "Distributions" DistributionConfiguration
-> DistributionConfiguration -> DistributionConfiguration
set PropertyType "Distributions" DistributionConfiguration
newValue DistributionConfiguration {[DistributionProperty]
Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DistributionConfiguration -> ()
description :: DistributionConfiguration -> Maybe (Value Text)
distributions :: DistributionConfiguration -> [DistributionProperty]
name :: DistributionConfiguration -> Value Text
tags :: DistributionConfiguration -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
    = DistributionConfiguration {distributions :: [DistributionProperty]
distributions = [DistributionProperty]
PropertyType "Distributions" DistributionConfiguration
newValue, Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
instance Property "Name" DistributionConfiguration where
  type PropertyType "Name" DistributionConfiguration = Value Prelude.Text
  set :: PropertyType "Name" DistributionConfiguration
-> DistributionConfiguration -> DistributionConfiguration
set PropertyType "Name" DistributionConfiguration
newValue DistributionConfiguration {[DistributionProperty]
Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DistributionConfiguration -> ()
description :: DistributionConfiguration -> Maybe (Value Text)
distributions :: DistributionConfiguration -> [DistributionProperty]
name :: DistributionConfiguration -> Value Text
tags :: DistributionConfiguration -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
    = DistributionConfiguration {name :: Value Text
name = PropertyType "Name" DistributionConfiguration
Value Text
newValue, [DistributionProperty]
Maybe (Map Text (Value Text))
Maybe (Value Text)
()
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
tags :: Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
tags :: Maybe (Map Text (Value Text))
..}
instance Property "Tags" DistributionConfiguration where
  type PropertyType "Tags" DistributionConfiguration = Prelude.Map Prelude.Text (Value Prelude.Text)
  set :: PropertyType "Tags" DistributionConfiguration
-> DistributionConfiguration -> DistributionConfiguration
set PropertyType "Tags" DistributionConfiguration
newValue DistributionConfiguration {[DistributionProperty]
Maybe (Map Text (Value Text))
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DistributionConfiguration -> ()
description :: DistributionConfiguration -> Maybe (Value Text)
distributions :: DistributionConfiguration -> [DistributionProperty]
name :: DistributionConfiguration -> Value Text
tags :: DistributionConfiguration -> Maybe (Map Text (Value Text))
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
name :: Value Text
tags :: Maybe (Map Text (Value Text))
..}
    = DistributionConfiguration {tags :: Maybe (Map Text (Value Text))
tags = Map Text (Value Text) -> Maybe (Map Text (Value Text))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure Map Text (Value Text)
PropertyType "Tags" DistributionConfiguration
newValue, [DistributionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
name :: Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
distributions :: [DistributionProperty]
name :: Value Text
..}