module Stratosphere.Budgets.Budget.TimePeriodProperty (
        TimePeriodProperty(..), mkTimePeriodProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data TimePeriodProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-budgets-budget-timeperiod.html>
    TimePeriodProperty {TimePeriodProperty -> ()
haddock_workaround_ :: (),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-budgets-budget-timeperiod.html#cfn-budgets-budget-timeperiod-end>
                        TimePeriodProperty -> Maybe (Value Text)
end :: (Prelude.Maybe (Value Prelude.Text)),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-budgets-budget-timeperiod.html#cfn-budgets-budget-timeperiod-start>
                        TimePeriodProperty -> Maybe (Value Text)
start :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (TimePeriodProperty -> TimePeriodProperty -> Bool
(TimePeriodProperty -> TimePeriodProperty -> Bool)
-> (TimePeriodProperty -> TimePeriodProperty -> Bool)
-> Eq TimePeriodProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TimePeriodProperty -> TimePeriodProperty -> Bool
== :: TimePeriodProperty -> TimePeriodProperty -> Bool
$c/= :: TimePeriodProperty -> TimePeriodProperty -> Bool
/= :: TimePeriodProperty -> TimePeriodProperty -> Bool
Prelude.Eq, Int -> TimePeriodProperty -> ShowS
[TimePeriodProperty] -> ShowS
TimePeriodProperty -> String
(Int -> TimePeriodProperty -> ShowS)
-> (TimePeriodProperty -> String)
-> ([TimePeriodProperty] -> ShowS)
-> Show TimePeriodProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TimePeriodProperty -> ShowS
showsPrec :: Int -> TimePeriodProperty -> ShowS
$cshow :: TimePeriodProperty -> String
show :: TimePeriodProperty -> String
$cshowList :: [TimePeriodProperty] -> ShowS
showList :: [TimePeriodProperty] -> ShowS
Prelude.Show)
mkTimePeriodProperty :: TimePeriodProperty
mkTimePeriodProperty :: TimePeriodProperty
mkTimePeriodProperty
  = TimePeriodProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), end :: Maybe (Value Text)
end = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       start :: Maybe (Value Text)
start = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties TimePeriodProperty where
  toResourceProperties :: TimePeriodProperty -> ResourceProperties
toResourceProperties TimePeriodProperty {Maybe (Value Text)
()
haddock_workaround_ :: TimePeriodProperty -> ()
end :: TimePeriodProperty -> Maybe (Value Text)
start :: TimePeriodProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
end :: Maybe (Value Text)
start :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Budgets::Budget.TimePeriod",
         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 -> 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
"End" (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)
end,
                            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
"Start" (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)
start])}
instance JSON.ToJSON TimePeriodProperty where
  toJSON :: TimePeriodProperty -> Value
toJSON TimePeriodProperty {Maybe (Value Text)
()
haddock_workaround_ :: TimePeriodProperty -> ()
end :: TimePeriodProperty -> Maybe (Value Text)
start :: TimePeriodProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
end :: Maybe (Value Text)
start :: Maybe (Value Text)
..}
    = [(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 -> 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
"End" (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)
end,
               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
"Start" (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)
start]))
instance Property "End" TimePeriodProperty where
  type PropertyType "End" TimePeriodProperty = Value Prelude.Text
  set :: PropertyType "End" TimePeriodProperty
-> TimePeriodProperty -> TimePeriodProperty
set PropertyType "End" TimePeriodProperty
newValue TimePeriodProperty {Maybe (Value Text)
()
haddock_workaround_ :: TimePeriodProperty -> ()
end :: TimePeriodProperty -> Maybe (Value Text)
start :: TimePeriodProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
end :: Maybe (Value Text)
start :: Maybe (Value Text)
..}
    = TimePeriodProperty {end :: Maybe (Value Text)
end = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "End" TimePeriodProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
start :: Maybe (Value Text)
haddock_workaround_ :: ()
start :: Maybe (Value Text)
..}
instance Property "Start" TimePeriodProperty where
  type PropertyType "Start" TimePeriodProperty = Value Prelude.Text
  set :: PropertyType "Start" TimePeriodProperty
-> TimePeriodProperty -> TimePeriodProperty
set PropertyType "Start" TimePeriodProperty
newValue TimePeriodProperty {Maybe (Value Text)
()
haddock_workaround_ :: TimePeriodProperty -> ()
end :: TimePeriodProperty -> Maybe (Value Text)
start :: TimePeriodProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
end :: Maybe (Value Text)
start :: Maybe (Value Text)
..}
    = TimePeriodProperty {start :: Maybe (Value Text)
start = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Start" TimePeriodProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
end :: Maybe (Value Text)
haddock_workaround_ :: ()
end :: Maybe (Value Text)
..}