module Stratosphere.ApiGateway.UsagePlan.ApiStageProperty (
module Exports, ApiStageProperty(..), mkApiStageProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.ApiGateway.UsagePlan.ThrottleSettingsProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ApiStageProperty
=
ApiStageProperty {ApiStageProperty -> ()
haddock_workaround_ :: (),
ApiStageProperty -> Maybe (Value Text)
apiId :: (Prelude.Maybe (Value Prelude.Text)),
ApiStageProperty -> Maybe (Value Text)
stage :: (Prelude.Maybe (Value Prelude.Text)),
ApiStageProperty -> Maybe (Map Text ThrottleSettingsProperty)
throttle :: (Prelude.Maybe (Prelude.Map Prelude.Text ThrottleSettingsProperty))}
deriving stock (ApiStageProperty -> ApiStageProperty -> Bool
(ApiStageProperty -> ApiStageProperty -> Bool)
-> (ApiStageProperty -> ApiStageProperty -> Bool)
-> Eq ApiStageProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ApiStageProperty -> ApiStageProperty -> Bool
== :: ApiStageProperty -> ApiStageProperty -> Bool
$c/= :: ApiStageProperty -> ApiStageProperty -> Bool
/= :: ApiStageProperty -> ApiStageProperty -> Bool
Prelude.Eq, Int -> ApiStageProperty -> ShowS
[ApiStageProperty] -> ShowS
ApiStageProperty -> String
(Int -> ApiStageProperty -> ShowS)
-> (ApiStageProperty -> String)
-> ([ApiStageProperty] -> ShowS)
-> Show ApiStageProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ApiStageProperty -> ShowS
showsPrec :: Int -> ApiStageProperty -> ShowS
$cshow :: ApiStageProperty -> String
show :: ApiStageProperty -> String
$cshowList :: [ApiStageProperty] -> ShowS
showList :: [ApiStageProperty] -> ShowS
Prelude.Show)
mkApiStageProperty :: ApiStageProperty
mkApiStageProperty :: ApiStageProperty
mkApiStageProperty
= ApiStageProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), apiId :: Maybe (Value Text)
apiId = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
stage :: Maybe (Value Text)
stage = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, throttle :: Maybe (Map Text ThrottleSettingsProperty)
throttle = Maybe (Map Text ThrottleSettingsProperty)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ApiStageProperty where
toResourceProperties :: ApiStageProperty -> ResourceProperties
toResourceProperties ApiStageProperty {Maybe (Map Text ThrottleSettingsProperty)
Maybe (Value Text)
()
haddock_workaround_ :: ApiStageProperty -> ()
apiId :: ApiStageProperty -> Maybe (Value Text)
stage :: ApiStageProperty -> Maybe (Value Text)
throttle :: ApiStageProperty -> Maybe (Map Text ThrottleSettingsProperty)
haddock_workaround_ :: ()
apiId :: Maybe (Value Text)
stage :: Maybe (Value Text)
throttle :: Maybe (Map Text ThrottleSettingsProperty)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::ApiGateway::UsagePlan.ApiStage",
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
"ApiId" (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)
apiId,
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
"Stage" (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)
stage,
Key -> Map Text ThrottleSettingsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Throttle" (Map Text ThrottleSettingsProperty -> (Key, Value))
-> Maybe (Map Text ThrottleSettingsProperty) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text ThrottleSettingsProperty)
throttle])}
instance JSON.ToJSON ApiStageProperty where
toJSON :: ApiStageProperty -> Value
toJSON ApiStageProperty {Maybe (Map Text ThrottleSettingsProperty)
Maybe (Value Text)
()
haddock_workaround_ :: ApiStageProperty -> ()
apiId :: ApiStageProperty -> Maybe (Value Text)
stage :: ApiStageProperty -> Maybe (Value Text)
throttle :: ApiStageProperty -> Maybe (Map Text ThrottleSettingsProperty)
haddock_workaround_ :: ()
apiId :: Maybe (Value Text)
stage :: Maybe (Value Text)
throttle :: Maybe (Map Text ThrottleSettingsProperty)
..}
= [(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
"ApiId" (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)
apiId,
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
"Stage" (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)
stage,
Key -> Map Text ThrottleSettingsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Throttle" (Map Text ThrottleSettingsProperty -> (Key, Value))
-> Maybe (Map Text ThrottleSettingsProperty) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Map Text ThrottleSettingsProperty)
throttle]))
instance Property "ApiId" ApiStageProperty where
type PropertyType "ApiId" ApiStageProperty = Value Prelude.Text
set :: PropertyType "ApiId" ApiStageProperty
-> ApiStageProperty -> ApiStageProperty
set PropertyType "ApiId" ApiStageProperty
newValue ApiStageProperty {Maybe (Map Text ThrottleSettingsProperty)
Maybe (Value Text)
()
haddock_workaround_ :: ApiStageProperty -> ()
apiId :: ApiStageProperty -> Maybe (Value Text)
stage :: ApiStageProperty -> Maybe (Value Text)
throttle :: ApiStageProperty -> Maybe (Map Text ThrottleSettingsProperty)
haddock_workaround_ :: ()
apiId :: Maybe (Value Text)
stage :: Maybe (Value Text)
throttle :: Maybe (Map Text ThrottleSettingsProperty)
..}
= ApiStageProperty {apiId :: Maybe (Value Text)
apiId = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ApiId" ApiStageProperty
Value Text
newValue, Maybe (Map Text ThrottleSettingsProperty)
Maybe (Value Text)
()
haddock_workaround_ :: ()
stage :: Maybe (Value Text)
throttle :: Maybe (Map Text ThrottleSettingsProperty)
haddock_workaround_ :: ()
stage :: Maybe (Value Text)
throttle :: Maybe (Map Text ThrottleSettingsProperty)
..}
instance Property "Stage" ApiStageProperty where
type PropertyType "Stage" ApiStageProperty = Value Prelude.Text
set :: PropertyType "Stage" ApiStageProperty
-> ApiStageProperty -> ApiStageProperty
set PropertyType "Stage" ApiStageProperty
newValue ApiStageProperty {Maybe (Map Text ThrottleSettingsProperty)
Maybe (Value Text)
()
haddock_workaround_ :: ApiStageProperty -> ()
apiId :: ApiStageProperty -> Maybe (Value Text)
stage :: ApiStageProperty -> Maybe (Value Text)
throttle :: ApiStageProperty -> Maybe (Map Text ThrottleSettingsProperty)
haddock_workaround_ :: ()
apiId :: Maybe (Value Text)
stage :: Maybe (Value Text)
throttle :: Maybe (Map Text ThrottleSettingsProperty)
..}
= ApiStageProperty {stage :: Maybe (Value Text)
stage = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Stage" ApiStageProperty
Value Text
newValue, Maybe (Map Text ThrottleSettingsProperty)
Maybe (Value Text)
()
haddock_workaround_ :: ()
apiId :: Maybe (Value Text)
throttle :: Maybe (Map Text ThrottleSettingsProperty)
haddock_workaround_ :: ()
apiId :: Maybe (Value Text)
throttle :: Maybe (Map Text ThrottleSettingsProperty)
..}
instance Property "Throttle" ApiStageProperty where
type PropertyType "Throttle" ApiStageProperty = Prelude.Map Prelude.Text ThrottleSettingsProperty
set :: PropertyType "Throttle" ApiStageProperty
-> ApiStageProperty -> ApiStageProperty
set PropertyType "Throttle" ApiStageProperty
newValue ApiStageProperty {Maybe (Map Text ThrottleSettingsProperty)
Maybe (Value Text)
()
haddock_workaround_ :: ApiStageProperty -> ()
apiId :: ApiStageProperty -> Maybe (Value Text)
stage :: ApiStageProperty -> Maybe (Value Text)
throttle :: ApiStageProperty -> Maybe (Map Text ThrottleSettingsProperty)
haddock_workaround_ :: ()
apiId :: Maybe (Value Text)
stage :: Maybe (Value Text)
throttle :: Maybe (Map Text ThrottleSettingsProperty)
..}
= ApiStageProperty {throttle :: Maybe (Map Text ThrottleSettingsProperty)
throttle = Map Text ThrottleSettingsProperty
-> Maybe (Map Text ThrottleSettingsProperty)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure Map Text ThrottleSettingsProperty
PropertyType "Throttle" ApiStageProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
apiId :: Maybe (Value Text)
stage :: Maybe (Value Text)
haddock_workaround_ :: ()
apiId :: Maybe (Value Text)
stage :: Maybe (Value Text)
..}