module Stratosphere.ApiGateway.UsagePlan.ThrottleSettingsProperty (
ThrottleSettingsProperty(..), mkThrottleSettingsProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ThrottleSettingsProperty
=
ThrottleSettingsProperty {ThrottleSettingsProperty -> ()
haddock_workaround_ :: (),
ThrottleSettingsProperty -> Maybe (Value Integer)
burstLimit :: (Prelude.Maybe (Value Prelude.Integer)),
ThrottleSettingsProperty -> Maybe (Value Double)
rateLimit :: (Prelude.Maybe (Value Prelude.Double))}
deriving stock (ThrottleSettingsProperty -> ThrottleSettingsProperty -> Bool
(ThrottleSettingsProperty -> ThrottleSettingsProperty -> Bool)
-> (ThrottleSettingsProperty -> ThrottleSettingsProperty -> Bool)
-> Eq ThrottleSettingsProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ThrottleSettingsProperty -> ThrottleSettingsProperty -> Bool
== :: ThrottleSettingsProperty -> ThrottleSettingsProperty -> Bool
$c/= :: ThrottleSettingsProperty -> ThrottleSettingsProperty -> Bool
/= :: ThrottleSettingsProperty -> ThrottleSettingsProperty -> Bool
Prelude.Eq, Int -> ThrottleSettingsProperty -> ShowS
[ThrottleSettingsProperty] -> ShowS
ThrottleSettingsProperty -> String
(Int -> ThrottleSettingsProperty -> ShowS)
-> (ThrottleSettingsProperty -> String)
-> ([ThrottleSettingsProperty] -> ShowS)
-> Show ThrottleSettingsProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ThrottleSettingsProperty -> ShowS
showsPrec :: Int -> ThrottleSettingsProperty -> ShowS
$cshow :: ThrottleSettingsProperty -> String
show :: ThrottleSettingsProperty -> String
$cshowList :: [ThrottleSettingsProperty] -> ShowS
showList :: [ThrottleSettingsProperty] -> ShowS
Prelude.Show)
mkThrottleSettingsProperty :: ThrottleSettingsProperty
mkThrottleSettingsProperty :: ThrottleSettingsProperty
mkThrottleSettingsProperty
= ThrottleSettingsProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), burstLimit :: Maybe (Value Integer)
burstLimit = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing,
rateLimit :: Maybe (Value Double)
rateLimit = Maybe (Value Double)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ThrottleSettingsProperty where
toResourceProperties :: ThrottleSettingsProperty -> ResourceProperties
toResourceProperties ThrottleSettingsProperty {Maybe (Value Double)
Maybe (Value Integer)
()
haddock_workaround_ :: ThrottleSettingsProperty -> ()
burstLimit :: ThrottleSettingsProperty -> Maybe (Value Integer)
rateLimit :: ThrottleSettingsProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
burstLimit :: Maybe (Value Integer)
rateLimit :: Maybe (Value Double)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::ApiGateway::UsagePlan.ThrottleSettings",
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 Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"BurstLimit" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
burstLimit,
Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RateLimit" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
rateLimit])}
instance JSON.ToJSON ThrottleSettingsProperty where
toJSON :: ThrottleSettingsProperty -> Value
toJSON ThrottleSettingsProperty {Maybe (Value Double)
Maybe (Value Integer)
()
haddock_workaround_ :: ThrottleSettingsProperty -> ()
burstLimit :: ThrottleSettingsProperty -> Maybe (Value Integer)
rateLimit :: ThrottleSettingsProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
burstLimit :: Maybe (Value Integer)
rateLimit :: Maybe (Value Double)
..}
= [(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 Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"BurstLimit" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
burstLimit,
Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RateLimit" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
rateLimit]))
instance Property "BurstLimit" ThrottleSettingsProperty where
type PropertyType "BurstLimit" ThrottleSettingsProperty = Value Prelude.Integer
set :: PropertyType "BurstLimit" ThrottleSettingsProperty
-> ThrottleSettingsProperty -> ThrottleSettingsProperty
set PropertyType "BurstLimit" ThrottleSettingsProperty
newValue ThrottleSettingsProperty {Maybe (Value Double)
Maybe (Value Integer)
()
haddock_workaround_ :: ThrottleSettingsProperty -> ()
burstLimit :: ThrottleSettingsProperty -> Maybe (Value Integer)
rateLimit :: ThrottleSettingsProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
burstLimit :: Maybe (Value Integer)
rateLimit :: Maybe (Value Double)
..}
= ThrottleSettingsProperty {burstLimit :: Maybe (Value Integer)
burstLimit = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "BurstLimit" ThrottleSettingsProperty
Value Integer
newValue, Maybe (Value Double)
()
haddock_workaround_ :: ()
rateLimit :: Maybe (Value Double)
haddock_workaround_ :: ()
rateLimit :: Maybe (Value Double)
..}
instance Property "RateLimit" ThrottleSettingsProperty where
type PropertyType "RateLimit" ThrottleSettingsProperty = Value Prelude.Double
set :: PropertyType "RateLimit" ThrottleSettingsProperty
-> ThrottleSettingsProperty -> ThrottleSettingsProperty
set PropertyType "RateLimit" ThrottleSettingsProperty
newValue ThrottleSettingsProperty {Maybe (Value Double)
Maybe (Value Integer)
()
haddock_workaround_ :: ThrottleSettingsProperty -> ()
burstLimit :: ThrottleSettingsProperty -> Maybe (Value Integer)
rateLimit :: ThrottleSettingsProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
burstLimit :: Maybe (Value Integer)
rateLimit :: Maybe (Value Double)
..}
= ThrottleSettingsProperty {rateLimit :: Maybe (Value Double)
rateLimit = Value Double -> Maybe (Value Double)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "RateLimit" ThrottleSettingsProperty
Value Double
newValue, Maybe (Value Integer)
()
haddock_workaround_ :: ()
burstLimit :: Maybe (Value Integer)
haddock_workaround_ :: ()
burstLimit :: Maybe (Value Integer)
..}