module Stratosphere.ApplicationSignals.ServiceLevelObjective.IntervalProperty (
        module Exports, IntervalProperty(..), mkIntervalProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.ApplicationSignals.ServiceLevelObjective.CalendarIntervalProperty as Exports
import {-# SOURCE #-} Stratosphere.ApplicationSignals.ServiceLevelObjective.RollingIntervalProperty as Exports
import Stratosphere.ResourceProperties
data IntervalProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationsignals-servicelevelobjective-interval.html>
    IntervalProperty {IntervalProperty -> ()
haddock_workaround_ :: (),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationsignals-servicelevelobjective-interval.html#cfn-applicationsignals-servicelevelobjective-interval-calendarinterval>
                      IntervalProperty -> Maybe CalendarIntervalProperty
calendarInterval :: (Prelude.Maybe CalendarIntervalProperty),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationsignals-servicelevelobjective-interval.html#cfn-applicationsignals-servicelevelobjective-interval-rollinginterval>
                      IntervalProperty -> Maybe RollingIntervalProperty
rollingInterval :: (Prelude.Maybe RollingIntervalProperty)}
  deriving stock (IntervalProperty -> IntervalProperty -> Bool
(IntervalProperty -> IntervalProperty -> Bool)
-> (IntervalProperty -> IntervalProperty -> Bool)
-> Eq IntervalProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IntervalProperty -> IntervalProperty -> Bool
== :: IntervalProperty -> IntervalProperty -> Bool
$c/= :: IntervalProperty -> IntervalProperty -> Bool
/= :: IntervalProperty -> IntervalProperty -> Bool
Prelude.Eq, Int -> IntervalProperty -> ShowS
[IntervalProperty] -> ShowS
IntervalProperty -> String
(Int -> IntervalProperty -> ShowS)
-> (IntervalProperty -> String)
-> ([IntervalProperty] -> ShowS)
-> Show IntervalProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IntervalProperty -> ShowS
showsPrec :: Int -> IntervalProperty -> ShowS
$cshow :: IntervalProperty -> String
show :: IntervalProperty -> String
$cshowList :: [IntervalProperty] -> ShowS
showList :: [IntervalProperty] -> ShowS
Prelude.Show)
mkIntervalProperty :: IntervalProperty
mkIntervalProperty :: IntervalProperty
mkIntervalProperty
  = IntervalProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), calendarInterval :: Maybe CalendarIntervalProperty
calendarInterval = Maybe CalendarIntervalProperty
forall a. Maybe a
Prelude.Nothing,
       rollingInterval :: Maybe RollingIntervalProperty
rollingInterval = Maybe RollingIntervalProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties IntervalProperty where
  toResourceProperties :: IntervalProperty -> ResourceProperties
toResourceProperties IntervalProperty {Maybe CalendarIntervalProperty
Maybe RollingIntervalProperty
()
haddock_workaround_ :: IntervalProperty -> ()
calendarInterval :: IntervalProperty -> Maybe CalendarIntervalProperty
rollingInterval :: IntervalProperty -> Maybe RollingIntervalProperty
haddock_workaround_ :: ()
calendarInterval :: Maybe CalendarIntervalProperty
rollingInterval :: Maybe RollingIntervalProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::ApplicationSignals::ServiceLevelObjective.Interval",
         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 -> CalendarIntervalProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CalendarInterval" (CalendarIntervalProperty -> (Key, Value))
-> Maybe CalendarIntervalProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CalendarIntervalProperty
calendarInterval,
                            Key -> RollingIntervalProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RollingInterval" (RollingIntervalProperty -> (Key, Value))
-> Maybe RollingIntervalProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RollingIntervalProperty
rollingInterval])}
instance JSON.ToJSON IntervalProperty where
  toJSON :: IntervalProperty -> Value
toJSON IntervalProperty {Maybe CalendarIntervalProperty
Maybe RollingIntervalProperty
()
haddock_workaround_ :: IntervalProperty -> ()
calendarInterval :: IntervalProperty -> Maybe CalendarIntervalProperty
rollingInterval :: IntervalProperty -> Maybe RollingIntervalProperty
haddock_workaround_ :: ()
calendarInterval :: Maybe CalendarIntervalProperty
rollingInterval :: Maybe RollingIntervalProperty
..}
    = [(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 -> CalendarIntervalProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CalendarInterval" (CalendarIntervalProperty -> (Key, Value))
-> Maybe CalendarIntervalProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CalendarIntervalProperty
calendarInterval,
               Key -> RollingIntervalProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RollingInterval" (RollingIntervalProperty -> (Key, Value))
-> Maybe RollingIntervalProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RollingIntervalProperty
rollingInterval]))
instance Property "CalendarInterval" IntervalProperty where
  type PropertyType "CalendarInterval" IntervalProperty = CalendarIntervalProperty
  set :: PropertyType "CalendarInterval" IntervalProperty
-> IntervalProperty -> IntervalProperty
set PropertyType "CalendarInterval" IntervalProperty
newValue IntervalProperty {Maybe CalendarIntervalProperty
Maybe RollingIntervalProperty
()
haddock_workaround_ :: IntervalProperty -> ()
calendarInterval :: IntervalProperty -> Maybe CalendarIntervalProperty
rollingInterval :: IntervalProperty -> Maybe RollingIntervalProperty
haddock_workaround_ :: ()
calendarInterval :: Maybe CalendarIntervalProperty
rollingInterval :: Maybe RollingIntervalProperty
..}
    = IntervalProperty {calendarInterval :: Maybe CalendarIntervalProperty
calendarInterval = CalendarIntervalProperty -> Maybe CalendarIntervalProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CalendarInterval" IntervalProperty
CalendarIntervalProperty
newValue, Maybe RollingIntervalProperty
()
haddock_workaround_ :: ()
rollingInterval :: Maybe RollingIntervalProperty
haddock_workaround_ :: ()
rollingInterval :: Maybe RollingIntervalProperty
..}
instance Property "RollingInterval" IntervalProperty where
  type PropertyType "RollingInterval" IntervalProperty = RollingIntervalProperty
  set :: PropertyType "RollingInterval" IntervalProperty
-> IntervalProperty -> IntervalProperty
set PropertyType "RollingInterval" IntervalProperty
newValue IntervalProperty {Maybe CalendarIntervalProperty
Maybe RollingIntervalProperty
()
haddock_workaround_ :: IntervalProperty -> ()
calendarInterval :: IntervalProperty -> Maybe CalendarIntervalProperty
rollingInterval :: IntervalProperty -> Maybe RollingIntervalProperty
haddock_workaround_ :: ()
calendarInterval :: Maybe CalendarIntervalProperty
rollingInterval :: Maybe RollingIntervalProperty
..}
    = IntervalProperty {rollingInterval :: Maybe RollingIntervalProperty
rollingInterval = RollingIntervalProperty -> Maybe RollingIntervalProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "RollingInterval" IntervalProperty
RollingIntervalProperty
newValue, Maybe CalendarIntervalProperty
()
haddock_workaround_ :: ()
calendarInterval :: Maybe CalendarIntervalProperty
haddock_workaround_ :: ()
calendarInterval :: Maybe CalendarIntervalProperty
..}