module Stratosphere.Pinpoint.Segment.BehaviorProperty (
        module Exports, BehaviorProperty(..), mkBehaviorProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Pinpoint.Segment.RecencyProperty as Exports
import Stratosphere.ResourceProperties
data BehaviorProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-segment-segmentdimensions-behavior.html>
    BehaviorProperty {BehaviorProperty -> ()
haddock_workaround_ :: (),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pinpoint-segment-segmentdimensions-behavior.html#cfn-pinpoint-segment-segmentdimensions-behavior-recency>
                      BehaviorProperty -> Maybe RecencyProperty
recency :: (Prelude.Maybe RecencyProperty)}
  deriving stock (BehaviorProperty -> BehaviorProperty -> Bool
(BehaviorProperty -> BehaviorProperty -> Bool)
-> (BehaviorProperty -> BehaviorProperty -> Bool)
-> Eq BehaviorProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BehaviorProperty -> BehaviorProperty -> Bool
== :: BehaviorProperty -> BehaviorProperty -> Bool
$c/= :: BehaviorProperty -> BehaviorProperty -> Bool
/= :: BehaviorProperty -> BehaviorProperty -> Bool
Prelude.Eq, Int -> BehaviorProperty -> ShowS
[BehaviorProperty] -> ShowS
BehaviorProperty -> String
(Int -> BehaviorProperty -> ShowS)
-> (BehaviorProperty -> String)
-> ([BehaviorProperty] -> ShowS)
-> Show BehaviorProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BehaviorProperty -> ShowS
showsPrec :: Int -> BehaviorProperty -> ShowS
$cshow :: BehaviorProperty -> String
show :: BehaviorProperty -> String
$cshowList :: [BehaviorProperty] -> ShowS
showList :: [BehaviorProperty] -> ShowS
Prelude.Show)
mkBehaviorProperty :: BehaviorProperty
mkBehaviorProperty :: BehaviorProperty
mkBehaviorProperty
  = BehaviorProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), recency :: Maybe RecencyProperty
recency = Maybe RecencyProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties BehaviorProperty where
  toResourceProperties :: BehaviorProperty -> ResourceProperties
toResourceProperties BehaviorProperty {Maybe RecencyProperty
()
haddock_workaround_ :: BehaviorProperty -> ()
recency :: BehaviorProperty -> Maybe RecencyProperty
haddock_workaround_ :: ()
recency :: Maybe RecencyProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Pinpoint::Segment.Behavior",
         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 -> RecencyProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Recency" (RecencyProperty -> (Key, Value))
-> Maybe RecencyProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecencyProperty
recency])}
instance JSON.ToJSON BehaviorProperty where
  toJSON :: BehaviorProperty -> Value
toJSON BehaviorProperty {Maybe RecencyProperty
()
haddock_workaround_ :: BehaviorProperty -> ()
recency :: BehaviorProperty -> Maybe RecencyProperty
haddock_workaround_ :: ()
recency :: Maybe RecencyProperty
..}
    = [(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 -> RecencyProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Recency" (RecencyProperty -> (Key, Value))
-> Maybe RecencyProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecencyProperty
recency]))
instance Property "Recency" BehaviorProperty where
  type PropertyType "Recency" BehaviorProperty = RecencyProperty
  set :: PropertyType "Recency" BehaviorProperty
-> BehaviorProperty -> BehaviorProperty
set PropertyType "Recency" BehaviorProperty
newValue BehaviorProperty {Maybe RecencyProperty
()
haddock_workaround_ :: BehaviorProperty -> ()
recency :: BehaviorProperty -> Maybe RecencyProperty
haddock_workaround_ :: ()
recency :: Maybe RecencyProperty
..}
    = BehaviorProperty {recency :: Maybe RecencyProperty
recency = RecencyProperty -> Maybe RecencyProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Recency" BehaviorProperty
RecencyProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}