module Stratosphere.CustomerProfiles.SegmentDefinition.DimensionProperty (
        module Exports, DimensionProperty(..), mkDimensionProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.CustomerProfiles.SegmentDefinition.CalculatedAttributeDimensionProperty as Exports
import {-# SOURCE #-} Stratosphere.CustomerProfiles.SegmentDefinition.ProfileAttributesProperty as Exports
import Stratosphere.ResourceProperties
data DimensionProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-customerprofiles-segmentdefinition-dimension.html>
    DimensionProperty {DimensionProperty -> ()
haddock_workaround_ :: (),
                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-customerprofiles-segmentdefinition-dimension.html#cfn-customerprofiles-segmentdefinition-dimension-calculatedattributes>
                       DimensionProperty
-> Maybe (Map Text CalculatedAttributeDimensionProperty)
calculatedAttributes :: (Prelude.Maybe (Prelude.Map Prelude.Text CalculatedAttributeDimensionProperty)),
                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-customerprofiles-segmentdefinition-dimension.html#cfn-customerprofiles-segmentdefinition-dimension-profileattributes>
                       DimensionProperty -> Maybe ProfileAttributesProperty
profileAttributes :: (Prelude.Maybe ProfileAttributesProperty)}
  deriving stock (DimensionProperty -> DimensionProperty -> Bool
(DimensionProperty -> DimensionProperty -> Bool)
-> (DimensionProperty -> DimensionProperty -> Bool)
-> Eq DimensionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DimensionProperty -> DimensionProperty -> Bool
== :: DimensionProperty -> DimensionProperty -> Bool
$c/= :: DimensionProperty -> DimensionProperty -> Bool
/= :: DimensionProperty -> DimensionProperty -> Bool
Prelude.Eq, Int -> DimensionProperty -> ShowS
[DimensionProperty] -> ShowS
DimensionProperty -> String
(Int -> DimensionProperty -> ShowS)
-> (DimensionProperty -> String)
-> ([DimensionProperty] -> ShowS)
-> Show DimensionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DimensionProperty -> ShowS
showsPrec :: Int -> DimensionProperty -> ShowS
$cshow :: DimensionProperty -> String
show :: DimensionProperty -> String
$cshowList :: [DimensionProperty] -> ShowS
showList :: [DimensionProperty] -> ShowS
Prelude.Show)
mkDimensionProperty :: DimensionProperty
mkDimensionProperty :: DimensionProperty
mkDimensionProperty
  = DimensionProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), calculatedAttributes :: Maybe (Map Text CalculatedAttributeDimensionProperty)
calculatedAttributes = Maybe (Map Text CalculatedAttributeDimensionProperty)
forall a. Maybe a
Prelude.Nothing,
       profileAttributes :: Maybe ProfileAttributesProperty
profileAttributes = Maybe ProfileAttributesProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DimensionProperty where
  toResourceProperties :: DimensionProperty -> ResourceProperties
toResourceProperties DimensionProperty {Maybe (Map Text CalculatedAttributeDimensionProperty)
Maybe ProfileAttributesProperty
()
haddock_workaround_ :: DimensionProperty -> ()
calculatedAttributes :: DimensionProperty
-> Maybe (Map Text CalculatedAttributeDimensionProperty)
profileAttributes :: DimensionProperty -> Maybe ProfileAttributesProperty
haddock_workaround_ :: ()
calculatedAttributes :: Maybe (Map Text CalculatedAttributeDimensionProperty)
profileAttributes :: Maybe ProfileAttributesProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::CustomerProfiles::SegmentDefinition.Dimension",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key
-> Map Text CalculatedAttributeDimensionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CalculatedAttributes" (Map Text CalculatedAttributeDimensionProperty -> (Key, Value))
-> Maybe (Map Text CalculatedAttributeDimensionProperty)
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text CalculatedAttributeDimensionProperty)
calculatedAttributes,
                            Key -> ProfileAttributesProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ProfileAttributes" (ProfileAttributesProperty -> (Key, Value))
-> Maybe ProfileAttributesProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProfileAttributesProperty
profileAttributes])}
instance JSON.ToJSON DimensionProperty where
  toJSON :: DimensionProperty -> Value
toJSON DimensionProperty {Maybe (Map Text CalculatedAttributeDimensionProperty)
Maybe ProfileAttributesProperty
()
haddock_workaround_ :: DimensionProperty -> ()
calculatedAttributes :: DimensionProperty
-> Maybe (Map Text CalculatedAttributeDimensionProperty)
profileAttributes :: DimensionProperty -> Maybe ProfileAttributesProperty
haddock_workaround_ :: ()
calculatedAttributes :: Maybe (Map Text CalculatedAttributeDimensionProperty)
profileAttributes :: Maybe ProfileAttributesProperty
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key
-> Map Text CalculatedAttributeDimensionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CalculatedAttributes" (Map Text CalculatedAttributeDimensionProperty -> (Key, Value))
-> Maybe (Map Text CalculatedAttributeDimensionProperty)
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text CalculatedAttributeDimensionProperty)
calculatedAttributes,
               Key -> ProfileAttributesProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ProfileAttributes" (ProfileAttributesProperty -> (Key, Value))
-> Maybe ProfileAttributesProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProfileAttributesProperty
profileAttributes]))
instance Property "CalculatedAttributes" DimensionProperty where
  type PropertyType "CalculatedAttributes" DimensionProperty = Prelude.Map Prelude.Text CalculatedAttributeDimensionProperty
  set :: PropertyType "CalculatedAttributes" DimensionProperty
-> DimensionProperty -> DimensionProperty
set PropertyType "CalculatedAttributes" DimensionProperty
newValue DimensionProperty {Maybe (Map Text CalculatedAttributeDimensionProperty)
Maybe ProfileAttributesProperty
()
haddock_workaround_ :: DimensionProperty -> ()
calculatedAttributes :: DimensionProperty
-> Maybe (Map Text CalculatedAttributeDimensionProperty)
profileAttributes :: DimensionProperty -> Maybe ProfileAttributesProperty
haddock_workaround_ :: ()
calculatedAttributes :: Maybe (Map Text CalculatedAttributeDimensionProperty)
profileAttributes :: Maybe ProfileAttributesProperty
..}
    = DimensionProperty
        {calculatedAttributes :: Maybe (Map Text CalculatedAttributeDimensionProperty)
calculatedAttributes = Map Text CalculatedAttributeDimensionProperty
-> Maybe (Map Text CalculatedAttributeDimensionProperty)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure Map Text CalculatedAttributeDimensionProperty
PropertyType "CalculatedAttributes" DimensionProperty
newValue, Maybe ProfileAttributesProperty
()
haddock_workaround_ :: ()
profileAttributes :: Maybe ProfileAttributesProperty
haddock_workaround_ :: ()
profileAttributes :: Maybe ProfileAttributesProperty
..}
instance Property "ProfileAttributes" DimensionProperty where
  type PropertyType "ProfileAttributes" DimensionProperty = ProfileAttributesProperty
  set :: PropertyType "ProfileAttributes" DimensionProperty
-> DimensionProperty -> DimensionProperty
set PropertyType "ProfileAttributes" DimensionProperty
newValue DimensionProperty {Maybe (Map Text CalculatedAttributeDimensionProperty)
Maybe ProfileAttributesProperty
()
haddock_workaround_ :: DimensionProperty -> ()
calculatedAttributes :: DimensionProperty
-> Maybe (Map Text CalculatedAttributeDimensionProperty)
profileAttributes :: DimensionProperty -> Maybe ProfileAttributesProperty
haddock_workaround_ :: ()
calculatedAttributes :: Maybe (Map Text CalculatedAttributeDimensionProperty)
profileAttributes :: Maybe ProfileAttributesProperty
..}
    = DimensionProperty {profileAttributes :: Maybe ProfileAttributesProperty
profileAttributes = ProfileAttributesProperty -> Maybe ProfileAttributesProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ProfileAttributes" DimensionProperty
ProfileAttributesProperty
newValue, Maybe (Map Text CalculatedAttributeDimensionProperty)
()
haddock_workaround_ :: ()
calculatedAttributes :: Maybe (Map Text CalculatedAttributeDimensionProperty)
haddock_workaround_ :: ()
calculatedAttributes :: Maybe (Map Text CalculatedAttributeDimensionProperty)
..}