module Stratosphere.IoT.MitigationAction (
        module Exports, MitigationAction(..), mkMitigationAction
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoT.MitigationAction.ActionParamsProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data MitigationAction
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-mitigationaction.html>
    MitigationAction {MitigationAction -> ()
haddock_workaround_ :: (),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-mitigationaction.html#cfn-iot-mitigationaction-actionname>
                      MitigationAction -> Maybe (Value Text)
actionName :: (Prelude.Maybe (Value Prelude.Text)),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-mitigationaction.html#cfn-iot-mitigationaction-actionparams>
                      MitigationAction -> ActionParamsProperty
actionParams :: ActionParamsProperty,
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-mitigationaction.html#cfn-iot-mitigationaction-rolearn>
                      MitigationAction -> Value Text
roleArn :: (Value Prelude.Text),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-mitigationaction.html#cfn-iot-mitigationaction-tags>
                      MitigationAction -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (MitigationAction -> MitigationAction -> Bool
(MitigationAction -> MitigationAction -> Bool)
-> (MitigationAction -> MitigationAction -> Bool)
-> Eq MitigationAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MitigationAction -> MitigationAction -> Bool
== :: MitigationAction -> MitigationAction -> Bool
$c/= :: MitigationAction -> MitigationAction -> Bool
/= :: MitigationAction -> MitigationAction -> Bool
Prelude.Eq, Int -> MitigationAction -> ShowS
[MitigationAction] -> ShowS
MitigationAction -> String
(Int -> MitigationAction -> ShowS)
-> (MitigationAction -> String)
-> ([MitigationAction] -> ShowS)
-> Show MitigationAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MitigationAction -> ShowS
showsPrec :: Int -> MitigationAction -> ShowS
$cshow :: MitigationAction -> String
show :: MitigationAction -> String
$cshowList :: [MitigationAction] -> ShowS
showList :: [MitigationAction] -> ShowS
Prelude.Show)
mkMitigationAction ::
  ActionParamsProperty -> Value Prelude.Text -> MitigationAction
mkMitigationAction :: ActionParamsProperty -> Value Text -> MitigationAction
mkMitigationAction ActionParamsProperty
actionParams Value Text
roleArn
  = MitigationAction
      {haddock_workaround_ :: ()
haddock_workaround_ = (), actionParams :: ActionParamsProperty
actionParams = ActionParamsProperty
actionParams,
       roleArn :: Value Text
roleArn = Value Text
roleArn, actionName :: Maybe (Value Text)
actionName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MitigationAction where
  toResourceProperties :: MitigationAction -> ResourceProperties
toResourceProperties MitigationAction {Maybe [Tag]
Maybe (Value Text)
()
Value Text
ActionParamsProperty
haddock_workaround_ :: MitigationAction -> ()
actionName :: MitigationAction -> Maybe (Value Text)
actionParams :: MitigationAction -> ActionParamsProperty
roleArn :: MitigationAction -> Value Text
tags :: MitigationAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
roleArn :: Value Text
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoT::MitigationAction",
         supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"ActionParams" Key -> ActionParamsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionParamsProperty
actionParams, Key
"RoleArn" 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..= Value Text
roleArn]
                           ([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
"ActionName" (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)
actionName,
                               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON MitigationAction where
  toJSON :: MitigationAction -> Value
toJSON MitigationAction {Maybe [Tag]
Maybe (Value Text)
()
Value Text
ActionParamsProperty
haddock_workaround_ :: MitigationAction -> ()
actionName :: MitigationAction -> Maybe (Value Text)
actionParams :: MitigationAction -> ActionParamsProperty
roleArn :: MitigationAction -> Value Text
tags :: MitigationAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
roleArn :: Value Text
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"ActionParams" Key -> ActionParamsProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionParamsProperty
actionParams, Key
"RoleArn" 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..= Value Text
roleArn]
              ([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
"ActionName" (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)
actionName,
                  Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "ActionName" MitigationAction where
  type PropertyType "ActionName" MitigationAction = Value Prelude.Text
  set :: PropertyType "ActionName" MitigationAction
-> MitigationAction -> MitigationAction
set PropertyType "ActionName" MitigationAction
newValue MitigationAction {Maybe [Tag]
Maybe (Value Text)
()
Value Text
ActionParamsProperty
haddock_workaround_ :: MitigationAction -> ()
actionName :: MitigationAction -> Maybe (Value Text)
actionParams :: MitigationAction -> ActionParamsProperty
roleArn :: MitigationAction -> Value Text
tags :: MitigationAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
roleArn :: Value Text
tags :: Maybe [Tag]
..}
    = MitigationAction {actionName :: Maybe (Value Text)
actionName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ActionName" MitigationAction
Value Text
newValue, Maybe [Tag]
()
Value Text
ActionParamsProperty
haddock_workaround_ :: ()
actionParams :: ActionParamsProperty
roleArn :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
actionParams :: ActionParamsProperty
roleArn :: Value Text
tags :: Maybe [Tag]
..}
instance Property "ActionParams" MitigationAction where
  type PropertyType "ActionParams" MitigationAction = ActionParamsProperty
  set :: PropertyType "ActionParams" MitigationAction
-> MitigationAction -> MitigationAction
set PropertyType "ActionParams" MitigationAction
newValue MitigationAction {Maybe [Tag]
Maybe (Value Text)
()
Value Text
ActionParamsProperty
haddock_workaround_ :: MitigationAction -> ()
actionName :: MitigationAction -> Maybe (Value Text)
actionParams :: MitigationAction -> ActionParamsProperty
roleArn :: MitigationAction -> Value Text
tags :: MitigationAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
roleArn :: Value Text
tags :: Maybe [Tag]
..}
    = MitigationAction {actionParams :: ActionParamsProperty
actionParams = PropertyType "ActionParams" MitigationAction
ActionParamsProperty
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
roleArn :: Value Text
tags :: Maybe [Tag]
..}
instance Property "RoleArn" MitigationAction where
  type PropertyType "RoleArn" MitigationAction = Value Prelude.Text
  set :: PropertyType "RoleArn" MitigationAction
-> MitigationAction -> MitigationAction
set PropertyType "RoleArn" MitigationAction
newValue MitigationAction {Maybe [Tag]
Maybe (Value Text)
()
Value Text
ActionParamsProperty
haddock_workaround_ :: MitigationAction -> ()
actionName :: MitigationAction -> Maybe (Value Text)
actionParams :: MitigationAction -> ActionParamsProperty
roleArn :: MitigationAction -> Value Text
tags :: MitigationAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
roleArn :: Value Text
tags :: Maybe [Tag]
..}
    = MitigationAction {roleArn :: Value Text
roleArn = PropertyType "RoleArn" MitigationAction
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
ActionParamsProperty
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
tags :: Maybe [Tag]
..}
instance Property "Tags" MitigationAction where
  type PropertyType "Tags" MitigationAction = [Tag]
  set :: PropertyType "Tags" MitigationAction
-> MitigationAction -> MitigationAction
set PropertyType "Tags" MitigationAction
newValue MitigationAction {Maybe [Tag]
Maybe (Value Text)
()
Value Text
ActionParamsProperty
haddock_workaround_ :: MitigationAction -> ()
actionName :: MitigationAction -> Maybe (Value Text)
actionParams :: MitigationAction -> ActionParamsProperty
roleArn :: MitigationAction -> Value Text
tags :: MitigationAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
roleArn :: Value Text
tags :: Maybe [Tag]
..}
    = MitigationAction {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" MitigationAction
newValue, Maybe (Value Text)
()
Value Text
ActionParamsProperty
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
roleArn :: Value Text
haddock_workaround_ :: ()
actionName :: Maybe (Value Text)
actionParams :: ActionParamsProperty
roleArn :: Value Text
..}